BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi all,

I am having problems fitting a quadratic term to a model in Proc Mixed. The following is my code (which exactly mimics the code given in Littell's SAS for Mixed Models book at the top of p. 196):

proc mixed data=all_means_analysis noprofile;
title1 'Heterogeneous Autoregressive Mixed Model';
class treatment drought week pot;
model meanphoto = treatment drought week w w2 treatment*drought treatment*week treatment*w treatment*w2 treatment*drought*week treatment*drought*w treatment*drought*w2/htype=1;
repeated week / type=arh(1) sub=pot(treatment);
parms (1.2526) (1.2526) (1.4143) (1.3907) (1.9521) (1.4706) (1.3724) (1.2562) (1.2165) (0.7997) (0.6041) (0.7220) (0.3535) (1.1845) (0.5467) (1.1075) (1.7849) (1.2526) (1.1370) (0.02428) (0.6188) / noiter;
run;

I am trying to look at photosynthetic rate over time, but it decreases over the growing season, so I think I need the quadratic term (w2 = week*week; w = week). But this is the output I get - without any error messages from the SAS system:

Type 3 Tests of Fixed Effects

Num Den
Effect DF DF F Value Pr > F

treatment 2 117 2.36 0.0989
drought 1 117 0.31 0.5790
week 14 779 43.40 <.0001
w 0 . . .
w2 0 . . .
treatment*drought 2 117 5.18 0.0070
treatment*week 27 779 0.97 0.5074
w*treatment 0 . . .
w2*treatment 0 . . .
treatme*drought*week 36 779 10.11 <.0001
w*treatment*drought 0 . . .
w2*treatment*drought 0 . . .

Is the model simply out of degrees of freedom? I have 123 samples, and when I remove some of the interactions from the model to free up some df, the model still will not fit any quadratic terms.

Someone has suggested that the problem here is that w and w2 are completely confounded with the class variable week, and so there are no degrees of freedom to estimate these parameters. But when I remove week as a class variable from the model, I get the following message:

ERROR: Only class variables allowed in this effect.

Help?!

Thanks!!!
2 REPLIES 2
deleted_user
Not applicable
The error message:

ERROR: Only class variables allowed in this effect

is a result of the fact that the REPEATED statement requires a class variable. Removing week as a class variable from the model violates this.

So, I am back to my initial question - thanks in advance for your help!
deleted_user
Not applicable
Hi all,

I think I may have found the solution: Keeping week as a class variable, using it in the REPEATED statement, but removing it from the model, seems to work.

Now, I just need to decide if keeping the quadratic term in the model is appropriate...

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5183 views
  • 0 likes
  • 1 in conversation