BookmarkSubscribeRSS Feed
JoakimE
Obsidian | Level 7

Hi,

 

Background:

Consider a simple ANOVA model to test for differences between treatments on some continuous PD-outcome variable. For this simple example, Levene's test can be applied to test homoscedasticity between treatments on the residual term. Using proc mixed, it is not possible to get Levene's test automatically from the model, but extracting the absolute values of the studentized residuals and then running the model again with the absolute residuals as the dependent variable, e.g. like this:

 

proc mixed data=residuals;
class treatment;
model abs_resid = treatment;
run;

 

and then looking at the p-value for the F-statistics would be the equivalent for Levene's test.

 

Current case:

However, I have a more complicated linnear mixed model, LMM, with treatment as a categorical explanatory variable, a continuous covariate (the baseline measurements) and subject within treatment (parallel study). Also, measurements are taken at two post-baseline timepoints, so there is a repeated measurements situation. I use all post-baseline measurements and include the (post-baseline) timepoint and the interaction treatment*timepoint as categorical effects in the  model. This is this model definition:

 

proc mixed data=example_data;
class subject treatment timepoint;
model change_from_baseline = treatment|timepoint baseline / ddfm=kenwardroger2 outp=residuals RESIDUAL;
repeated timepoint / subject=subject (treatment );
run;

 

Questions:

Given my more complicated model, compared to the ANOVA situation:

  • Would Levene's test still be applicable using the simple code stated under background above (i.e. taking the absolute values of the residuals from the LMM as the dependent variable in a simple ANOVA)?
  • Or would I need to run the full LMM model code using absolute residuals as the dependent variable? If I do that, I get a p-value for the all the effects treatment, timepoint, treatment*timepoint and baseline. Should I then check that all F-test p-values are non-significant?
  • Or, if Levene's test is not applicable at all for more complicated models, is there another more appropriate test that can be used? If not, I guess graphical investigation of predicted values vs. residuals would have to suffice to check the homoscedasticity assumption.

Many thank for any useful input in this situation!

 

Kind Regards,

Joakim

 

 

2 REPLIES 2
SteveDenham
Jade | Level 19

The GLIMMIX procedure has a specific COVTEST for homogeneity of variance components.  Check the documentation for specifics on how to implement this, as it requires a group= option in the RANDOM statement.

 

Note that the test is a log likelihood ratio test, which in a fully fixed effect model is not as powerful as Levene's test.  But since GLIMMIX allows you to easily fit a heterogeneous variance situation, it's not an issue (at least in my field).

 

I also caution you about fitting a change from baseline response with baseline as a covariate. The model is algebraically identical to fitting the response with baseline as a covariate save that the coefficient for the covariate in the change from baseline is equal to the coefficient minus one for the straight response variable.

 

SteveDenham

JoakimE
Obsidian | Level 7

Many thanks Steve. Yes, I will look into proc glimmix. Seems to be more versatile than proc mixed in many respects.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1204 views
  • 2 likes
  • 2 in conversation