if function with Boolean Operators

Discuss the jamovi platform, possible improvements, etc.
Post Reply
winkhaing
Posts: 2
Joined: Sun Jan 09, 2022 5:08 am

if function with Boolean Operators

Post by winkhaing »

Hello, I want to recategorize my continuous score into 5 groups. Eg., Age of Respondent. <25, 26-35, 36-45, 46-55 and >=56. How could I combine (if function) with (AND, OR - Boolean Operators)? Thanks.
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: if function with Boolean Operators

Post by jonathon »

you certainly can. you can use and or or like this:
Screen Shot 2022-01-09 at 19.19.01.png
Screen Shot 2022-01-09 at 19.19.01.png (69.38 KiB) Viewed 2847 times
however, in your case, you don't actually need to use the and/or ... you can simply go:
Screen Shot 2022-01-09 at 19.19.35.png
Screen Shot 2022-01-09 at 19.19.35.png (70.4 KiB) Viewed 2847 times
the if resolves with the first successul match.

cheers
winkhaing
Posts: 2
Joined: Sun Jan 09, 2022 5:08 am

Re: if function with Boolean Operators

Post by winkhaing »

Okay, I got the point.
Thank you.
gunnarbb
Posts: 2
Joined: Thu May 11, 2023 8:56 pm

Re: if function with Boolean Operators

Post by gunnarbb »

Thank you for this answer. I'm also making number categories. If we make a bar chart of the categories, they always seem to be in alphabetical order, is there any way to change the order of the categories?
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: if function with Boolean Operators

Post by jonathon »

hi,

this is an old discussion, you would be better posting a new topic/question.

if you open the variable with the variable editor (details here: http://docs.jamovi.org/_pages/um_4_spreadsheet.html ), you can reorder the levels of the variable. the plots display the "categories" in the order specified for the variable.

jonathon
Post Reply