Programming the statistical procedures from SAS

How to standardize "solution for random effects" in GLIMMIX to find extreme outliers?

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

How to standardize "solution for random effects" in GLIMMIX to find extreme outliers?

Hello,

I am a new SAS user, stats is not my expertise and I need help. I am trying to conduct model diagnostics in GLIMMIX to check the normality of residuals and extreme outliers at the highest level. I am checking these assumptions at the highest levels because some sources said residuals at the lowest levels are not very informative. I have a two-level model. I am able to get the "solution for random effects" at the highest level using the codes below. Since I am using LAPLACE, according to the SAS manual, these are the "empirical Bayes estimates (EBE) of ." or I am gonna call them Estimates. I get all these Estimates in my ODS OUTPUT command by putting SOLUTIONR. Can I treat these Estimates as residuals of the highest level? If yes then I can check whether these "residuals" are normal. Also, if that is case then how do I standardize these Estimates so I could check for extreme outliers at the highest level. Thanks.

proc glimmix data=final method=LAPLACE;

   class group X1 X2 ;

   model outcome = X1 X2 X1|X2/

       link=logit d=binomial s;

random int/ sub=group s;

   covtest 0;

ods output solutionr=groupLevel;

run;


Accepted Solutions
Solution
‎03-31-2015 10:01 AM
Valued Guide
Valued Guide
Posts: 684

Re: How to standardize "solution for random effects" in GLIMMIX to find extreme outliers?

Actually, the predictions of random effects (i.e., EBLUPS) sometimes are called hierarchical "residuals". Page 454-455 in Stroup (2013) considers them a type of residual. In principle, one could assess whether they are normally distributed, etc. However, the formula to calculate EBLUPS assumes normality; thus, the typical ways of diagnosing (regular) residuals will not work that well. They may look more normal than they really are. Fortunately, the linear mixed model and the generalized linear mixed models are fairly robust to nonnormality of the random effects. Chuck McCulloch and others have investigated this.

View solution in original post


All Replies
Respected Advisor
Posts: 2,655

Re: How to standardize "solution for random effects" in GLIMMIX to find extreme outliers?

The "estimates" are NOT residuals, but are best linear unbiased predictions (BLUPs).  You can get residuals by subtracting the fixed effect means, but realize that the difference accounts for all levels of random effects.  Use of the OUTPUT statement can give you the predicted and residual values on the logit scale or the original scale depending on the use of the ILINK option.

But WHY are you checking for normality of residuals--you are assuming a binomial distribution.  There is no need whatsoever to check for normality, and if you happened to find it, it would be spurious anyway.  Your values are bounded above and below, and thus residuals will also be bounded, and will NOT be normal, at least on the original scale.  They may be normal on the logit scale, but again, why bother?  You don't have to have normally distributed residuals as an assumption.  They only have to be IID - independent and identically distributed.

I don't know what version of SAS/STAT you are using, but try adding a PLOTS option to your PROC GLIMMIX statement.  That will help in detecting extreme values.

Steve Denham

Solution
‎03-31-2015 10:01 AM
Valued Guide
Valued Guide
Posts: 684

Re: How to standardize "solution for random effects" in GLIMMIX to find extreme outliers?

Actually, the predictions of random effects (i.e., EBLUPS) sometimes are called hierarchical "residuals". Page 454-455 in Stroup (2013) considers them a type of residual. In principle, one could assess whether they are normally distributed, etc. However, the formula to calculate EBLUPS assumes normality; thus, the typical ways of diagnosing (regular) residuals will not work that well. They may look more normal than they really are. Fortunately, the linear mixed model and the generalized linear mixed models are fairly robust to nonnormality of the random effects. Chuck McCulloch and others have investigated this.

Valued Guide
Valued Guide
Posts: 684

Re: How to standardize "solution for random effects" in GLIMMIX to find extreme outliers?

For your information....

You can also get the EBLUPS in the output file for observations by using an OUTPUT statement together with an ID statement.

proc glimmix data=final method=LAPLACE;

   class group X1 X2 ;

   model outcome = X1 X2 X1|X2/

       link=logit d=binomial s;

random int/ sub=group s;

   covtest 0;

ods output solutionr=groupLevel;

output out=out pred=p resid=r ;

id _zgamma_;

run;


Here, _zgamma_ is the syntax for Zgamma term in the mixed model (the random effect, EBLUP). You can then plot these with SGPLOT or other procedure, and look at distributional properties with UNIVARIATE.

New Contributor
Posts: 3

Re: How to standardize "solution for random effects" in GLIMMIX to find extreme outliers?

Thank you Steve and lvm, really appreciate your inputs. I was looking for what lvm said, thanks for providing the sources and codes!

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 593 views
  • 8 likes
  • 3 in conversation