BookmarkSubscribeRSS Feed
mgrzyb
Quartz | Level 8

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

195930715569596471525464675066415156736475No
236367416461276771766878756064626554837260No
244630455329514865542946536228273837406565No
256856504363544227616868604359386154673075No
267576818275717571797982798584728077827277No
287249495825526860425767547069426874687276No
155858394380715349343354574053553656236758No
165761624259766966387871646664757972676766No
176339655857524757625240625465636152454961No
185858585552696864678068717583575278646873No
206365434324232521354142585161505540595646No
216264697984837473877185788074657683757789No
224467698275787544907579807374738481838273No
276362687772656766608558907581727678747470No
296756536037672368526368342839623665526256No

 

However, I attached my results (on the loose-leaf paper) and I think that is the only that went through. 

 

 

 

 

 

3 REPLIES 3
pau13rown
Lapis Lazuli | Level 10

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

mgrzyb
Quartz | Level 8

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!

PaigeMiller
Diamond | Level 26

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. 

--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

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.

Discussion stats
  • 3 replies
  • 1313 views
  • 0 likes
  • 3 in conversation