Hello, I am intersted in recoding or creating a new variable using logic (if/then statements) from another variable? My current code is not working: Summary of data set: I have an 21 item measure (Q1-Q21), with 25% of sessions (S1-12) SecondaryObserver_S1 (can be 0 or 1) - was there a secondary observer for first sessions PrimaryObserver_S1_Q1 (can be 0, 1, 2, or .) - Likert type variable for session 1 question 1 PrimaryObserver_S1_Q2 (can be 0, 1, 2, or .)- Likert type variable for session 1 question 2 .... PrimaryObserver_S1_Q.21 (can be 0 or 1) -etc ... SecondaryObserver_S12 (can be 0 or 1)- was there a secondary observer for second session PrimaryObserver_S12_Q1 (can be 0, 1, 2, or .) - Likert type variable for session 2 question 1 PrimaryObserver_S12_Q2 (can be0, 1, 2, or .) - etc .... PrimaryObserver_S12_Q.21 (0, 1, 2, or .) I would like to to retain primary observer's data only if there was a secondary observer. I tried: IF SecondaryObserver_S1 = 0 THEN PrimaryObserver_S1_Q1 = . IF SecondaryObserver_S1 = 0 THEN PrimaryObserver_S1_Q2 = . IF SecondaryObserver_S1 = 0 THEN PrimaryObserver_S1_Q21 = . The code runs, but it is not recoding any variables. I have used if/then/else statements for recoding a variable using the logic/conditions of that variable, but never using logic of other variables. Is this possible, or are there any suggested solutions?
... View more