Search code examples
rr-markdownspssbinning

Binning categorial variables in SPSS


I have two different variables which are both categorical. One of them is the seriousness of the sickness in terms of degrees. The other one is the type of surgery.And my dependent variable is their recovery day after the surgery. Because the days of surgery is not normally distributed I have to use a non-parametric method. So I need to combine the independent variables into a new variable: 1:sickness1Surgery1 2:sickness1Surgery2, 3:sickness2Surgery1, sickness2Surgery1. By this way I will be able to test it. I have checked the Youtube but, they are all about how to bin scales into categories.


Solution

  • If you provide more details about the structure of your data (preferably with some sample data) we could provide better suited code. Still, the basic idea should be the same:

    if sickness=1 and surgery=1 combinedVar=1.
    if sickness=2 and surgery=1 combinedVar=2.
    if sickness=1 and surgery=2 combinedVar=3.
    if sickness=2 and surgery=2 combinedVar=4.
    
    value labels combinedVar
      1  "sickness=1, surgery=1"
      2  "sickness=2, surgery=1"
      3  "sickness=1, surgery=2"
      4  "sickness=2, surgery=2".