Formula for computed variable: a certain value in at least one out of multiple cells = XY
Posted: Thu Oct 26, 2023 12:41 pm
Hi there,
I am trying to compute a new variable in which I can group my sample into 4 subgroups depending on how the participants answered a number of items. My desired groups would be like this:
3 strong: at least one item out of PM02_01 to PM02_11 has to be rated with "4" AND at least five additional items out of PM02_01 to PM02_27 have to be rated with "4" AND at least one item out of PM03_01 to PM03_02 has to be rated with "4".
2 moderate: at least one item out of PM02_01 to PM02_11 has to be rated with "3" or "4" AND at least five additional items out of PM02_01 to PM02_27 have to be rated with "3" or "4" AND at least one item out of PM03_01 to PM03_02 has to be rated with "3" or "4".
1 mild: at least one item out of PM02_01 to PM02_27 has to be rated with "3" or "4" AND at least one item out of PM03_01 to PM03_02 has to be rated with "3" or "4".
0 none: none of the criteria above are met.
My goal would be that every participant can be sorted into one of those groups but not be in multiple groups at once (since people in the group "strong" would obviously also meet the criteria for group "moderate" and "mild").
My problem is that I can't find out how to tell jamovi to select a participant if a specific value ("3" or "4") is present in one out of multiple cells. I found a post for Excel in which the answer was something along the line =IF(COUNTIF(PM02_01:PM02_27, "3", "4" AND PM03_01:PM03_03, "3", "4") "mild", "none"). I tried that in jamovi but it tells me that the formula is mis-specified but I googled and couldn't finde the corresponding terms for jamovi. And even then I wouldn't be sure how to include the other groups into the formula as well...
Does anyone have an idea what the correct formula for the new computed variable could be? I'd be very grateful!!!
Best wishes
Alex
I am trying to compute a new variable in which I can group my sample into 4 subgroups depending on how the participants answered a number of items. My desired groups would be like this:
3 strong: at least one item out of PM02_01 to PM02_11 has to be rated with "4" AND at least five additional items out of PM02_01 to PM02_27 have to be rated with "4" AND at least one item out of PM03_01 to PM03_02 has to be rated with "4".
2 moderate: at least one item out of PM02_01 to PM02_11 has to be rated with "3" or "4" AND at least five additional items out of PM02_01 to PM02_27 have to be rated with "3" or "4" AND at least one item out of PM03_01 to PM03_02 has to be rated with "3" or "4".
1 mild: at least one item out of PM02_01 to PM02_27 has to be rated with "3" or "4" AND at least one item out of PM03_01 to PM03_02 has to be rated with "3" or "4".
0 none: none of the criteria above are met.
My goal would be that every participant can be sorted into one of those groups but not be in multiple groups at once (since people in the group "strong" would obviously also meet the criteria for group "moderate" and "mild").
My problem is that I can't find out how to tell jamovi to select a participant if a specific value ("3" or "4") is present in one out of multiple cells. I found a post for Excel in which the answer was something along the line =IF(COUNTIF(PM02_01:PM02_27, "3", "4" AND PM03_01:PM03_03, "3", "4") "mild", "none"). I tried that in jamovi but it tells me that the formula is mis-specified but I googled and couldn't finde the corresponding terms for jamovi. And even then I wouldn't be sure how to include the other groups into the formula as well...
Does anyone have an idea what the correct formula for the new computed variable could be? I'd be very grateful!!!
Best wishes
Alex