BookmarkSubscribeRSS Feed
KushalKC
Calcite | Level 5

I am using SAS for linear mixed modeling in my dataset.  The model also consists of three covariates. During the modeling process, I am also checking on whether there is an interaction between covariates and a group variable (one of the other fixed effect variables). For this, I included three interaction terms in the model between three covariates and the group variable. However, the addition of interaction terms inflates the denominator degree of freedom more than what is expected. Without interaction terms, the denominator degrees of freedom look fine. Any thoughts or suggestions on this?

6 REPLIES 6
jiltao
SAS Super FREQ

what happens if you add ddfm=kr option in your MODEL statement in PROC MIXED?

Jill

SteveDenham
Jade | Level 19

Or even just ddfm=bw, especially if you have a REPEATED statement and a RANDOM statement. The default in that case is the containment method, which can end up with some very large df for whole plot comparisons. I agree with @jiltao  - try ddfm=kr or ddfm=kr2. If the degrees of freedom look approximately like what you expect, it turns into a win-win, as the standard errors will have the proper shrinkage.

 

SteveDenham

KushalKC
Calcite | Level 5

Actually, I was fitting the model with kenward-roger degree of freedom adjustment. And the resulted denominator freedom does not match what is expected. What could be the possible reasons for incorrect ddf computation?

StatsMan
SAS Super FREQ

If you can post the code you are using, with and without the interactions, and the output from both then that would give us a better understanding of what is happening here.

KushalKC
Calcite | Level 5

Here are the codes and results. 

1. Model without interaction

SAS code

proc glimmix data=MY_DATA_soy plots=(residualpanel studentpanel);
	class Group Time Field Field_Group GroupTime;
	model logbiomass =  CC_percent Blue_Green_ratio SR_RE Group|Time/ ddfm = kenwardroger solution;
	random intercept Time / subject = Field(Group);
	
	output out=DiagnGLIMMIX student=Student predicted=Predicted; 
	
run;

Type III test result

KushalKC_0-1707491678364.png

 

2. Model with interaction

proc glimmix data=MY_DATA_soy plots=(residualpanel studentpanel);
	class Group Time Field Field_Group GroupTime;
	model logbiomass =  CC_percent Blue_Green_ratio SR_RE Group*CC_percent Group*SR_RE Group*Blue_Green_ratio Group|Time/ ddfm = kenwardroger solution;
	random intercept Time / subject = Field(Group);
	
	output out=DiagnGLIMMIX student=Student predicted=Predicted; 
	
run;

 

Type III test result

KushalKC_1-1707491791429.png

 

SteveDenham
Jade | Level 19

Mr. Google was my friend today. Searching on "Kenward roger approximation" led to this: https://documentation.sas.com/doc/en/statug/15.2/statug_glimmix_details40.htm 

 

From this you will see that the denominator degrees of freedom is a solution to an equation, rather than the (n-1) or (n-1)(m-1) you think of as the design denominator degrees of freedom. If they happen to come out to the same value, it is because the data are balanced and the covariance matrices associated do not result in any shrinkage of the standard errors.

 

So if the KR ddfm values are not completely inappropriate (such as ddf =1 in a repeated measures design), they represent a less biased approach to the analysis. Even better for controlling bias would be KR2.

 

SteveDenham

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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