BookmarkSubscribeRSS Feed
JOEY21
Calcite | Level 5

I have been trying to run a Repeated measures anova to analyze if there are differences in cover averages of native plants between four different treatments over time. I have been using the following UCLA stats link to code using PROC MIXED and PROC GLM.

Link 

 

PROC MIXED

PROC MIXED DATA=work.import1;
  CLASS subject treatment trial;
  MODEL cover_average = treatment trial treatment*trial;
  REPEATED trial / SUBJECT=subject TYPE=CS;
run;

PROC GLM

PROC GLM DATA=WORK.IMPORT;
	CLASS TREATMENT;
	MODEL MONTH1-MONTH9 = TREATMENT / NOUNI;
	REPEATED TREATMENT 9;
RUN;

The article didn't provide a way for me to interpret the results so I need help in interpreting the attached output. Thank you.

4 REPLIES 4
SteveDenham
Jade | Level 19

Before we get into interpretation, you will need to modify your PROC MIXED code.  Note that there are factors in the ANOVA table with 0 denominator degrees of freedom.  You will have to provide the denominator degrees of freedom with a ddf= option, or switch to a nondefault method like Satterthwaite or Kenward-Rogers. Additionally, for measurements over time, a compound symmetry assumption does not model any autoregressive error.  That is, time points closer together in time should have a higher correlation of errors than those separated farther in time. Compound symmetry assumes that the covariance between timepoints is constant and equal. I would suggest the following

 

PROC MIXED DATA=work.import1;
  CLASS subject treatment trial;
  MODEL cover_average = treatment trial treatment*trial/ddfm= kenwardrogers2 ;
  REPEATED trial / SUBJECT=subject TYPE=AR(1);
run;

Also, the plots from PROC CORR indicate that cover_average has a long tail to the right, so that the errors likely do not have a normal distribution.  That could be addressed by using PROC GLIMMIX with an appropriate distribution and link function, but for now, try the PROC MIXED code suggested and we can address the question of interpretation.

 

SteveDenham

 

JOEY21
Calcite | Level 5

Hello,

 

I made those adjustments but it seems the Autoregression removed results.

SteveDenham
Jade | Level 19

I cannot tell what happened by looking at the output - there must be something in the log that indicates why the program ran into issues.  Could you post the log?

 

SteveDenham

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

We need to focus on your experimental design.

 

As specified in your model, Subject is random effects factor. The coding for Subject doesn't really matter--it's just an identification code specified as a classification factor in the CLASS statement. In your PROC MIXED output, Subject has values of

 

1 2 3 0.5 1.5 0.25 0.75 0.3333333333 0.6666666667

 

which suggests to me that you might not be thinking of Subject in an appropriate way (typically, Subject might be coded as a/b/c... or 1/2/3...). A model that is not consistent with the design would be the cause of zero df and missing p values, and too few observations for the model you have specified.

 

To help you sort this out, we need to know the details of your experimental design--something like a concise Methods section in a manuscript.

 

I hope this helps move you forward.

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4 replies
  • 1321 views
  • 1 like
  • 3 in conversation