Hi everyone,
I need to double check that the inlist function below will not "count" the same value twice.
For context, I am scoring a cognitive function test. Participants were told to remember 10 words. They then had 20 attempts at saying the 10 words back. The words have been given a numerical value from 1 to 10. I need to confirm that according to the syntax below, if a participant said the first word three times, they only get 1 point and not 3. I can't think of an assert statement that would check this effectively.
Thank you,
Emma
gen cpait_word = 0
quietly foreach word in cpait_Word1_20 cpait_Word1_21 cpait_Word1_22 cpait_Word1_23 cpait_Word1_24 ///
cpait_Word1_25 cpait_Word1_26 cpait_Word1_27 cpait_Word1_28 cpait_Word1_29 ///
cpait_Word1_30 cpait_Word1_31 cpait_Word1_32 cpait_Word1_33 cpait_Word1_34 ///
cpait_Word1_35 cpait_Word1_36 cpait_Word1_37 cpait_Word1_38 cpait_Word1_39 {
replace cpait_word = cpait_word + inlist(`word', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) if `word' !=.
}
tab cpait_word, m
I need to double check that the inlist function below will not "count" the same value twice.
For context, I am scoring a cognitive function test. Participants were told to remember 10 words. They then had 20 attempts at saying the 10 words back. The words have been given a numerical value from 1 to 10. I need to confirm that according to the syntax below, if a participant said the first word three times, they only get 1 point and not 3. I can't think of an assert statement that would check this effectively.
Thank you,
Emma
gen cpait_word = 0
quietly foreach word in cpait_Word1_20 cpait_Word1_21 cpait_Word1_22 cpait_Word1_23 cpait_Word1_24 ///
cpait_Word1_25 cpait_Word1_26 cpait_Word1_27 cpait_Word1_28 cpait_Word1_29 ///
cpait_Word1_30 cpait_Word1_31 cpait_Word1_32 cpait_Word1_33 cpait_Word1_34 ///
cpait_Word1_35 cpait_Word1_36 cpait_Word1_37 cpait_Word1_38 cpait_Word1_39 {
replace cpait_word = cpait_word + inlist(`word', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) if `word' !=.
}
tab cpait_word, m
Comment