help with nominal variable transformation issue

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
xav90
Posts: 8
Joined: Tue Feb 21, 2023 2:29 am

help with nominal variable transformation issue

Post by xav90 »

Hi all,
Hoping for some help transforming a list of ~ 137 codes into 4 buckets, say A, B, C and unknown. While the codes are numbers they are nominal in nature and in no specific order (so I can just say if less than 50 use A for example). So, last night I started doing this with individual recode conditions but after about my 15th one I decided to try an "or" function on the if side which seemed to work when I briefly tested it. I then went on to to write just a few more lengthy recode conditions to the effect of:

if $source == "1" or "7" or "12"..... use 'group A'

Unfortunately, when I finished this whole process it put everyone in Group A. I'm not sure how/why but hoping someone can help with this.

Thanks so much!

Jamovi newbie Xavier
User avatar
jonathon
Posts: 2617
Joined: Fri Jan 27, 2017 10:04 am

Re: help with nominal variable transformation issue

Post by jonathon »

it needs to be

if $source == 1 or $source == 7 or $source == 12 ...

but you can just go

if $source < 50
xav90
Posts: 8
Joined: Tue Feb 21, 2023 2:29 am

Re: help with nominal variable transformation issue

Post by xav90 »

Thank you so much! Unfortunately it wasn't something like age where I could use < for > functions but adding in the "or $source ==" syntax did the trick.

Thanks again!
Post Reply