Page 1 of 1
if function with Boolean Operators
Posted: Sun Jan 09, 2022 5:28 am
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.
Re: if function with Boolean Operators
Posted: Sun Jan 09, 2022 8:21 am
by jonathon
you certainly can. you can use and or or like this:
- Screen Shot 2022-01-09 at 19.19.01.png (69.38 KiB) Viewed 3147 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 (70.4 KiB) Viewed 3147 times
the if resolves with the first successul match.
cheers
Re: if function with Boolean Operators
Posted: Sun Jan 09, 2022 9:38 am
by winkhaing
Okay, I got the point.
Thank you.
Re: if function with Boolean Operators
Posted: Tue May 23, 2023 2:40 pm
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?
Re: if function with Boolean Operators
Posted: Fri May 26, 2023 2:02 am
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