Page 1 of 1

Using a variable IF another variable meets criteria

Posted: Tue Jun 07, 2022 2:45 am
by amajoy
Hello - I'm stumped on this one.

I have two versions of a test, Test A and Test B.
I have two conditions, Control and Experimental
Participants receive a pre-test, and a post-test.
Participants can receive A first / as the pre-test, or B first/ as the pre-test, randomly assigned when condition is assigned.
I need to create a "Pretest Score" for ALL participants, and if they were in Control A or Experimental A, that pretest will be Test A. If they were in Control B or Experimental B, that pretest will be Test B.

The data are already in my data frame as Test A or Test B, but not if that was pre-test or post-test. I can post-process the CSV output in Excel to do a few conditional statements, but then I have to hand-update that code with every export of my results. I"d rather do it in Jamovi so I can set up the analyses and append results as they come. .

Is there a neat way to do this?

Re: Using a variable IF another variable meets criteria

Posted: Tue Jun 07, 2022 2:49 pm
by amajoy
So, what I keep trying to do is like this: FILTER(`Test 1 Score`, Condition == 'Control12' or Condition == 'Experimental12 ') AND ('`Test 2 Score`, Condition == 'Control21' or Condition == 'Experimental21") , but it seems like you can't do complicated strings in Jamovi?

Re: Using a variable IF another variable meets criteria

Posted: Fri Jun 10, 2022 1:48 am
by jonathon
there's lots of ways to do this. do you simply want

IF(Condition == 'Control12' or Condition == 'Experiment12', TestA, TestB)

there's no problem combining things with ors and ands if you need something more complex.