Recoding variables - everything becomes 'else use'
Posted: Wed Sep 20, 2023 1:18 pm
Hi there,
it feels kinda stupid but I have a problem with recoding variables and I can't seem to find my mistake. I used a similar formula for recoding variables in a different dataset and there everything worked fine but now every cell gets filled with whatever I put in the "else use" collumn (in this case -9). I simply want to change the numbers from 1 -> 0 ; 2 -> 1 and -9 = -9.
The recode conditions read:
fx if $source == 0 use '1'
fx if $source == 1 use '2'
else use '-9'
Does someone know what my mistake could be?
Thank you in advance!
it feels kinda stupid but I have a problem with recoding variables and I can't seem to find my mistake. I used a similar formula for recoding variables in a different dataset and there everything worked fine but now every cell gets filled with whatever I put in the "else use" collumn (in this case -9). I simply want to change the numbers from 1 -> 0 ; 2 -> 1 and -9 = -9.
The recode conditions read:
fx if $source == 0 use '1'
fx if $source == 1 use '2'
else use '-9'
Does someone know what my mistake could be?
Thank you in advance!