Post by Rich Ulrich
On Tue, 25 Aug 2020 05:37:17 -0700 (PDT), Bruce Weaver
Post by Bruce Weaver Post by Alba Johnsen
I have a variable which has 5 values. I need to mix 1,2,3 and 6,7 together. to make a 2 variable, but I dont know how. Please help!!!
The item is : What did you do with your photos
1. I shared them
2.I plan to share them
3. I streamed when I was in the concer
6. I didnt share it
so now I need to make a new variable with 1,2,3
to do Anova
Please generate a small data listing of several cases that shows what the data look like now, and what you want it to look like afterwards.
My guess is that the intention is to create a dichotomy, in
a new variable. Thus.
RECODE Photos(1,2,3=1)(6,7=2)(else=9) into Share .
Value labels Share(1) share (2) not share.
Ah, okay. That makes sense. But what happened to 4 and 5?
If it is a dichotomous Yes/No variable named Share, my preference is to use 1=Yes, 0=No coding. So my version of Rich's code would be:
RECODE Photos (1 2 4 = 1) (6 7 = 0) (ELSE = 9) INTO Share.
VALUE LABELS Share 1 "Yes" 0 "No" 9 "Missing".
MISSING VALUES Share (9).
With this coding, I can write code such as:
IF Share ...
IF NOT Share ...
I think this is more readable than:
IF Share EQ 1 ...
IF Share EQ 2 ...