Recoding variables - everything becomes 'else use'

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
alex99
Posts: 6
Joined: Wed Sep 20, 2023 12:58 pm

Recoding variables - everything becomes 'else use'

Post by alex99 »

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!
User avatar
MAgojam
Posts: 422
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: Recoding variables - everything becomes 'else use'

Post by MAgojam »

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:
ScreenShot_20230920230642.jpeg
ScreenShot_20230920230642.jpeg (107.37 KiB) Viewed 3530 times
Cheers,
Maurizio
alex99
Posts: 6
Joined: Wed Sep 20, 2023 12:58 pm

Re: Recoding variables - everything becomes 'else use'

Post by alex99 »

Hi Maurizio,

yes, that was it - now everything works. Thank you so much for your quick help!

All the best
Alex
Post Reply