Discussion:
Combining Two Categorical Variables into One Categorical Variable with 4 Levels
(too old to reply)
Jourdan Wilson
2022-10-13 06:25:23 UTC
Permalink
Hello,

I am new to SPSS and need some help. I have two categorical variables (var1 and var2) which are coded 0 - No, 1 - Yes. I am trying to assign participants to one of four groups based on these two variables.

The four groups would be:
Group 1 - var1 = 0, var2 = 0
Group 2 - var1 = 0, var 2 =1
Group 3 - var1=1, var2 = 0
Group 4 - var1 = 1, var2 = 1

Can anyone here explain to me how to do this, preferably in plain English, because I am not very knowledgeable about SPSS or coding.
Rich Ulrich
2022-10-13 17:23:01 UTC
Permalink
On Wed, 12 Oct 2022 23:25:23 -0700 (PDT), Jourdan Wilson
Post by Jourdan Wilson
Hello,
I am new to SPSS and need some help. I have two categorical variables (var1 and var2) which are coded 0 - No, 1 - Yes. I am trying to assign participants to one of four groups based on these two variables.
Group 1 - var1 = 0, var2 = 0
Group 2 - var1 = 0, var 2 =1
Group 3 - var1=1, var2 = 0
Group 4 - var1 = 1, var2 = 1
Can anyone here explain to me how to do this, preferably in plain English, because I am not very knowledgeable about SPSS or coding.
COMPUTE Grp = 2*var1 + var2 + 1.

Check/clean your data beforehand so that you know the only
values present for var1 and var2 are zero and one.

Sometimes, to make a legitimate Group of "missing", one would add,
RECODE grp(SYSMIS=5).
--
Rich Ulrich
Loading...