Soldato
- Joined
- 22 Jan 2014
- Posts
- 3,863
SOLVED - Coding query - why is it doing this?!
**ALWAYS check spelling for the fifth or sixth, or indeed twentieth time. I was one letter out**
Afternoon all,
I am having some difficulty in understanding why this bit of code is doing what it is in SPSS!
What I want it to do is to RECODE the variable ZopicloneCheck from '1' to '0' only if the below conditions are met. However, it is also recoding those which DO NOT qualify (e.g. Zopiclonepm=2) from ZopicloneCheck=1 to ZopicloneCheck=0 as well.
Any ideas as to why?
DO IF (Zopiclonepm=1 or Zopiclonepm=3) and (Zopicloneimp=1 or Zopicloneimp=3) and (Zopiclonepresc=1 or Zopiclonepresc=3).
RECODE ZopicloneCheck (1=0).
END IF.
EXECUTE.
**ALWAYS check spelling for the fifth or sixth, or indeed twentieth time. I was one letter out**
Afternoon all,
I am having some difficulty in understanding why this bit of code is doing what it is in SPSS!
What I want it to do is to RECODE the variable ZopicloneCheck from '1' to '0' only if the below conditions are met. However, it is also recoding those which DO NOT qualify (e.g. Zopiclonepm=2) from ZopicloneCheck=1 to ZopicloneCheck=0 as well.
Any ideas as to why?
DO IF (Zopiclonepm=1 or Zopiclonepm=3) and (Zopicloneimp=1 or Zopicloneimp=3) and (Zopiclonepresc=1 or Zopiclonepresc=3).
RECODE ZopicloneCheck (1=0).
END IF.
EXECUTE.
Last edited: