Hi. I am sorry to bother you!
But I am in the process of learning several things.
I have a data set with 20 repeated measures (S1-s20), and I just want to do an ANOVA with repeated measures. My code is below. (There has to be simpler way on how to code that.) I have 2 groups - those who play video games and those who do not play games.
I did the proc mixed to test for the trend and interactions already - I get that part.
But many of the publications I am reading did a 1-way ANOVA by gaming status. I did a 2-way analysis by the long way. (the code is below).
1. I have attached how the datasets are set up - those for who play games and those who do not.
2. I have attached my results (on the loose-leaf scanned sheet.
My questions:
1. Is there an easier way to do this - see code below? I just want to stratify by gaming status (no proc GLM at this time).
2. After looking at the loose-leaf results (NOgamers and GAMERS), I have the mean, SD and p-value where SX-S1, DO I NEED TO DIVIDE THE P-VALUE by 19? I think so, but my gut says there is an easier way to do this and a more accurate way.
3. What if I want to test the differences by S2-S1, S3-S2, S4-S3, …. S20-S19 for each group? Could someone help me with that code just using each stratum individually? All the other publications have that.
Personally, I think these type of analyses are not required b/c PROC MIXED using GAMINGSTATUS and SIM score should be used.
But please help me.
Thank you, Kindly!
Mava
Here is my code: * I tried to attach 2 attachments, but I think only 1 went through. So I will include my:
1. Code
2. dataset by gaming status
1. CODE
/* 2-sided from sX- x1 */
proc ttest data= elina.widenogamer; paired s2*s1; run;
proc ttest data= elina.widenogamer; paired s3*s1; run;
proc ttest data= elina.widenogamer; paired s4*s1; run;
proc ttest data= elina.widenogamer; paired s5*s1; run;
proc ttest data= elina.widenogamer; paired s6*s1; run;
proc ttest data= elina.widenogamer; paired s7*s1; run;
proc ttest data= elina.widenogamer; paired s8*s1; run;
proc ttest data= elina.widenogamer; paired s9*s1; run;
proc ttest data= elina.widenogamer; paired s10*s1; run;
proc ttest data= elina.widenogamer; paired s11*s1; run;
proc ttest data= elina.widenogamer; paired s12*s1; run;
proc ttest data= elina.widenogamer; paired s13*s1; run;
proc ttest data= elina.widenogamer; paired s14*s1; run;
proc ttest data= elina.widenogamer; paired s15*s1; run;
proc ttest data= elina.widenogamer; paired s16*s1; run;
proc ttest data= elina.widenogamer; paired s17*s1; run;
proc ttest data= elina.widenogamer; paired s18*s1; run;
proc ttest data= elina.widenogamer; paired s19*s1; run;
proc ttest data= elina.widenogamer; paired s20*s1; run;
2. Data set : I only included NON-GAMERS, but it looks the same for gamers.
Version:1.0 StartHTML:000000278 EndHTML:000046968 StartFragment:000035246 EndFragment:000046936 StartSelection:000035246 EndSelection:000046936 SourceURL:file:///C:/Users/Mary%20Grzybowski/AppData/Local/Temp/SAS%20Temporary%20Files/_TD628_DESKTOP-SC2ACST_/sashtml21.htmSAS Output
Play NO Games |
19 | 59 | 30 | 71 | 55 | 69 | 59 | 64 | 71 | 52 | 54 | 64 | 67 | 50 | 66 | 41 | 51 | 56 | 73 | 64 | 75 | No |
23 | 63 | 67 | 41 | 64 | 61 | 27 | 67 | 71 | 76 | 68 | 78 | 75 | 60 | 64 | 62 | 65 | 54 | 83 | 72 | 60 | No |
24 | 46 | 30 | 45 | 53 | 29 | 51 | 48 | 65 | 54 | 29 | 46 | 53 | 62 | 28 | 27 | 38 | 37 | 40 | 65 | 65 | No |
25 | 68 | 56 | 50 | 43 | 63 | 54 | 42 | 27 | 61 | 68 | 68 | 60 | 43 | 59 | 38 | 61 | 54 | 67 | 30 | 75 | No |
26 | 75 | 76 | 81 | 82 | 75 | 71 | 75 | 71 | 79 | 79 | 82 | 79 | 85 | 84 | 72 | 80 | 77 | 82 | 72 | 77 | No |
28 | 72 | 49 | 49 | 58 | 25 | 52 | 68 | 60 | 42 | 57 | 67 | 54 | 70 | 69 | 42 | 68 | 74 | 68 | 72 | 76 | No |
15 | 58 | 58 | 39 | 43 | 80 | 71 | 53 | 49 | 34 | 33 | 54 | 57 | 40 | 53 | 55 | 36 | 56 | 23 | 67 | 58 | No |
16 | 57 | 61 | 62 | 42 | 59 | 76 | 69 | 66 | 38 | 78 | 71 | 64 | 66 | 64 | 75 | 79 | 72 | 67 | 67 | 66 | No |
17 | 63 | 39 | 65 | 58 | 57 | 52 | 47 | 57 | 62 | 52 | 40 | 62 | 54 | 65 | 63 | 61 | 52 | 45 | 49 | 61 | No |
18 | 58 | 58 | 58 | 55 | 52 | 69 | 68 | 64 | 67 | 80 | 68 | 71 | 75 | 83 | 57 | 52 | 78 | 64 | 68 | 73 | No |
20 | 63 | 65 | 43 | 43 | 24 | 23 | 25 | 21 | 35 | 41 | 42 | 58 | 51 | 61 | 50 | 55 | 40 | 59 | 56 | 46 | No |
21 | 62 | 64 | 69 | 79 | 84 | 83 | 74 | 73 | 87 | 71 | 85 | 78 | 80 | 74 | 65 | 76 | 83 | 75 | 77 | 89 | No |
22 | 44 | 67 | 69 | 82 | 75 | 78 | 75 | 44 | 90 | 75 | 79 | 80 | 73 | 74 | 73 | 84 | 81 | 83 | 82 | 73 | No |
27 | 63 | 62 | 68 | 77 | 72 | 65 | 67 | 66 | 60 | 85 | 58 | 90 | 75 | 81 | 72 | 76 | 78 | 74 | 74 | 70 | No |
29 | 67 | 56 | 53 | 60 | 37 | 67 | 23 | 68 | 52 | 63 | 68 | 34 | 28 | 39 | 62 | 36 | 65 | 52 | 62 | 56 | No |
However, I attached my results (on the loose-leaf paper) and I think that is the only that went through.
you seem to have the right instinct eg you mention 'mixed modelling' and repeated measures anova but then you go astray. I did a quick google search, so this might not be the best example, but these data have the same structure as yours, thus their code is instructive: https://stats.idre.ucla.edu/sas/faq/how-can-i-perform-a-repeated-measures-anova-with-proc-mixed/
if you want to do something really 'simple' then maybe a friedman test
Thank you. I have that paper and have been following it. I just don't think that, like the other papers, who analyzed multiple simulation scores without "gaming status" is correct. But that is what the investigators want - that is, if S1 differes from s2, etc. I just think that's bad statistics. Thank you kindly!
proc ttest data= elina.widenogamer; paired s2*s1; run;
proc ttest data= elina.widenogamer; paired s3*s1; run;
proc ttest data= elina.widenogamer; paired s4*s1; run;
proc ttest data= elina.widenogamer; paired s5*s1; run;
proc ttest data= elina.widenogamer; paired s6*s1; run;
Performing PROC TTEST will use a different error term than a proper repeated measures analysis, and so I don't think PROC TTEST will give the right results here. In addition, the ability to compare difference S2–S1 and S3–S2 and so forth ought to be possible in GLM or MIXED.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.