Is there a DO IF/ELSE IF function in jamovi?

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 helpme » Fri Apr 23, 2021 8:46 am

Hello

I have variables where each parent have answered, and now I want to combine these by selecting mothers responses (var_1) where there is and when there's not I want to select fathers (var_2) answers into one computed variable. With mothers variable as priority.

I have the syntax to do this in SPSS, but I can't manage to do it in Jamovi. Have tried IF function and to use "or", but I am doing something wrong.

In SPSS the syntax is:

DO IF (MISSING(var_1)~=1).
COMPUTE computed_newvariable = var_1

ELSE IF (MISSING(var_2)~=1).
COMPUTE computed_newvariable = var_2

ELSE.
COMPUTE computed_newvariable = var_1

Hope someone can help me and would appreciate it very much! :nerd:
helpme
 
Posts: 4
Joined: Tue Apr 20, 2021 9:19 am

by MAgojam » Sat Apr 24, 2021 11:21 am

Hi, @helpme.
Is the suggestion that I am attaching you with the screenshot what you were looking for?

Cheers,
Maurizio
Screenshot.PNG
Screenshot.PNG (57.95 KiB) Viewed 2252 times
User avatar
MAgojam
 
Posts: 160
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

by helpme » Thu May 06, 2021 6:45 pm

THANK YOU so much!!!!
helpme
 
Posts: 4
Joined: Tue Apr 20, 2021 9:19 am


Return to Help