Computing variables with If-Then

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)

by DSK » Thu Apr 29, 2021 6:00 pm

It seems like I should be able to do this, but I can't seem to figure it out. Suppose I want to compute a new variable based on 2 existing variables, something like this:

If A=1 and B>9 then C=2
If A=1 and (B<10 and B>5) then C=1
Else C=0

Can someone tell me how to do this in Jamovi? Thanks!
DSK
 
Posts: 5
Joined: Mon May 25, 2020 9:34 pm

by jonathon » Fri Apr 30, 2021 12:00 am

i can't see anything wrong with those rules. if they're not working the way you expect, attach a screenshot.

cheers

jonathon
User avatar
jonathon
 
Posts: 1763
Joined: Fri Jan 27, 2017 10:04 am

by MAgojam » Fri Apr 30, 2021 11:33 am

Hi, @DSK.
Do you think the suggestion of this screenshot is what you are looking for?
IF_THEN_ELSE.PNG
IF_THEN_ELSE.PNG (46.22 KiB) Viewed 1869 times

Cheers,
Maurizio
User avatar
MAgojam
 
Posts: 160
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)


Return to Help