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!
Recoding variables - everything becomes 'else use'
Re: Recoding variables - everything becomes 'else use'
Hey @alex99,
what happens to you is due to the fact that the variable you want to recode is a Data type Text, but you are using it as if it were a Data type Integer.
The recoding conditions will be: Cheers,
Maurizio
what happens to you is due to the fact that the variable you want to recode is a Data type Text, but you are using it as if it were a Data type Integer.
The recoding conditions will be: Cheers,
Maurizio
Re: Recoding variables - everything becomes 'else use'
Hi Maurizio,
yes, that was it - now everything works. Thank you so much for your quick help!
All the best
Alex
yes, that was it - now everything works. Thank you so much for your quick help!
All the best
Alex