Post by ottuba on Dec 8, 2020 17:50:14 GMT
Hi everybody, quick question:
I would like to set a label's value based on values of two other separate labels. For my data analysis, I want to compare gamers with non-gamers (simply put). For this, I have a questionnaire. Each group has to fulfill certain criteria to count as nongamer or gamer respectively -- see the very long code below:
*
l: current_and_past_non_gamer_1_if_TRUE
t: set
- if $Bavelier_Questionnaire_DURING_past_12_months.1 <= 1 and $Bavelier_Questionnaire_DURING_past_12_months.2 <= 1 and $Bavelier_Questionnaire_DURING_past_12_months.3 <= 1 and $Bavelier_Questionnaire_DURING_past_12_months.4 <= 1 and $Bavelier_Questionnaire_DURING_past_12_months.5 <= 2 and $Bavelier_Questionnaire_DURING_past_12_months.6 <= 2 and $Bavelier_Questionnaire_DURING_past_12_months.7 <= 2 and $Bavelier_Questionnaire_DURING_past_12_months.8 <= 2 and $DURING_past_12_months_SCORESUM <= 5 and $Bavelier_Questionnaire_BEFORE_past_12_months.1 <= 1 and $Bavelier_Questionnaire_BEFORE_past_12_months.2 <= 1 and $Bavelier_Questionnaire_BEFORE_past_12_months.3 <= 1 and $Bavelier_Questionnaire_BEFORE_past_12_months.4 <= 1 and $Bavelier_Questionnaire_BEFORE_past_12_months.5 <= 2 and $Bavelier_Questionnaire_BEFORE_past_12_months.6 <= 2 and $Bavelier_Questionnaire_BEFORE_past_12_months.7 <= 2 and $Bavelier_Questionnaire_BEFORE_past_12_months.8 <= 2 and $BEFORE_past_12_months_SCORESUM <= 5 then 1
*
l: current_heavy_league_player_1_if_TRUE
t: set
- if $Bavelier_Questionnaire_DURING_past_12_months.1 <= 2 and $Bavelier_Questionnaire_DURING_past_12_months.2 <= 2 and $Bavelier_Questionnaire_DURING_past_12_months.3 <= 2 and $Bavelier_Questionnaire_DURING_past_12_months.4 >= 4 and $Bavelier_Questionnaire_DURING_past_12_months.5 <= 2 and $Bavelier_Questionnaire_DURING_past_12_months.6 <= 2 and $Bavelier_Questionnaire_DURING_past_12_months.7 <= 2 and $Bavelier_Questionnaire_DURING_past_12_months.8 <= 2 then
Now, what I want this new label to do is to check BOTH of these labels and set its own value accordingly, something like this:
l: 1_is_gamer_0_is_nongamer
t: set
- if $current_heavy_league_player_1_if_TRUE == 1 then 1 --> person is gamer and variable value is set as 1
t: set
- if $current_heavy_league_player_1_if_TRUE == 1 then 1 --> person is gamer and variable value is set as 1
- if $current_and_past_non_gamer_1_if_TRUE == 1 then 0 --> person is nongamer and variable value is set as 0
This is of course also just doable in SPSS but it would save me some cleanup work in my dataset if I could do this in psytoolkit. I have tried multiple variations of the t: set type but wasn't able to figure it out. You seem to only be able to do two "if" conditions if you're referring to the same variable in both conditions, e.g. 2 x "if $current_heavy_league_player_1_if_TRUE == ...", but due to the criteria I have for the groups this is not possible (unless I'm missing something)
Any help is appreciated!
Thanks,
Adani