BookmarkSubscribeRSS Feed
madpumpkinpie
Calcite | Level 5

Hello,

I am stuck to conduct two-way repeated measures ANOVA with two within-subject factors (Treatment and Time).

This data is just an example, but in this study 5 subjects join a study session three times. In each session, they are assigned one of the three kinds of test food (treatment) and their appetite is measured at 0, 15 and 30 minute points after the test food consumption. 

Please find the excel file attached.

 

I would like to examine the treatment effect, time effect and interaction effect on appetite score, as well as at which time point the appetite score significantly differs between treatments (if there is a significant effect of treatment).

 

It would be really helpful if you could provide me with code that I can examine these. I want to know the code for normal (?) proc GLM procedure with two within subject factors, but also want to compare the result with that of proc MIXED repeated growth curve model (considering Time as continuous variable).

 

Thank you in advance,

 

 

 

 

 

2 REPLIES 2
madpumpkinpie
Calcite | Level 5

 

proc glm;
     classes group;
     model Y1-Y12=group / nouni;
     repeated trt 3, time 4;
 run;

Hi again,

For the second question(https://communities.sas.com/t5/SAS-Statistical-Procedures/Two-within-subject-factors-repeated-measur...), there is no factor that is analogous to "group" (between subject factor). There are just two within-subject factors. How should I modify this code?

 

 

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

I moved the post from https://communities.sas.com/t5/SAS-Statistical-Procedures/PROC-GLM-repeated-measures-one-class-two-m... to keep threads tidy.

 

I would not use the GLM procedure. I think in terms of mixed models, and the model for this study could be constructed as a split-plot design, with whole plots (sessions) in blocks (subjects) with repeated measures. This format would allow you to accommodate the order of assignment of food treatments to sessions, as well as the temporal correlation among the three measurement times.

 

Maybe TIME would work well with a regression model, but there are only 3 levels and there's not much you can do other than a linear relationship. Maybe that would be appropriate for these data, maybe not.

 

For mixed models in SAS, SAS for Mixed Models, 2nd ed is an invaluable resource; an updated version ( SAS® for Mixed Models: An Introduction) is supposed to be released soon. If you run mixed models, you will benefit from reading it. At a more advanced level, Generalized Linear Mixed Models: Modern Concepts, Methods and Applications is also invaluable.

sas-innovate-2024.png

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.

 

Register now!

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
  • 2 replies
  • 3112 views
  • 0 likes
  • 2 in conversation