BookmarkSubscribeRSS Feed
cuy01
Calcite | Level 5

Could someone please confirm that the code below is for a repeated measures MANOVA? I was given this code and do not understand SAS programming well enough to decipher it all. I've been looking up how to code repeated measures MANOVA in SAS and have been finding different things, resulting in my confusion.

Just to give you a little background, diameter, height, and slope are the IVs. Trial is supposed to be the repeated measure. The DVs are Shld_P1_Abd, Shld_P1_Flex, and Wrist_P1.

data;

   input Subject          Diameter          Height          Slope          Trial

          Shld_P1_Abd          Shld_P1_Flex          Wrist_P1;

cards;

01          18          1          1          1          33.38568882          16.70412005          38.05523282

01          18          1          1          2          34.18666478          17.55598648          35.20134662

01          18          1          1          3          34.39176821          17.44692806          35.73618519

.

.

.

.

;

proc glm;

   class Subject Diameter Height Slope Trial;

    model Shld_P1_Abd          Shld_P1_Flex          Wrist_P1 =

               Diameter|Height|Slope subject trial subject*trial

               diameter*subject diameter*trial diameter*subject*trial

               Height*subject Height*trial Height*subject*trial

               Slope*subject Slope*trial Slope*subject*trial/ nouni;

    random subject trial subject*trial

               diameter*subject diameter*trial diameter*subject*trial

               Height*subject Height*trial Height*subject*trial

               Slope*subject Slope*trial Slope*subject*trial/ test;

               LSMEANS Diameter|Height|Slope / ADJUST=TUKEY PDIFF ;

                       run;

Hopefully this is enough information for someone to understand this. Any help would be greatly appreciated. Thanks.

2 REPLIES 2
SteveDenham
Jade | Level 19

This sure looks like a repeated measures analysis, with random effects thrown in.  In this code, trial is NOT a repeated factor, but rather a random effect.  The repeated nature is found in the three response variables measured on each subject. 

The documentation for PROC MIXED offers a different approach, that considers both the measure and trial as repeated factors.  Look for the Kronecker product structures for multivariate repeated measures.  I think that this would provide a better analysis in the long run, if in fact trial is repeated.

The code would look something like:

proc mixed data=long;

   class Subject Diameter Height Slope Trial Var;

/* The variable Var identifies the three response variables*/

    model response=

               Diameter|Height|Slope|Trial|Var ;

repeated Var Trial/ type=un@ar(1) subject=subject;

/* This assumes that the time between trials is equally spaced.  If not, then type=un@un would probably be a first choice*/

               LSMEANS Diameter|Height|Slope|Var / ADJUST=TUKEY DIFF ;

                       run;

This requires re-arranging the input dataset. Suppose you have the input set now, call it work.wide.

data long;

length var $12.;

set wide;

response=Shld_P1_Abd, var='Shld_P1_Abd';output;

response=Shld_P1_Flex; var='Shld_P1_Flex';output;

response=Wrist_P1;var='Wrist_P1';output;

drop Shld_P1_Abd Shld_P1_Flex Wrist_P1;

run;

This sets up the dataset for the doubly repeated measures.

cuy01
Calcite | Level 5

Thank you for your response. I will look into the PROC MIXED to see if that might be a better option for this situation.

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