BookmarkSubscribeRSS Feed
bigjer
Calcite | Level 5

Hello, 

 

I am trying to get % variance explained for the fixed effects from my proc mixed code for a mixed linear regression. Unfortunately, I do not know how to request this in my output. Here is an example of my current code:

 

Proc Mixed Data=Set covtest;
Class ClassVar;
Model Outcome = Predictor1 Predictor2 Predictor3/solution ddfm=kr;
Random intercept/subject=pedid;
Run;

 

If there is anyway to get this information in my output that would be great. 

 

Thanks, 

Jer

6 REPLIES 6
PaigeMiller
Diamond | Level 26

There is no such thing as an R-squared value for fixed effects. You get an R-squared value for an entire model being fit (and as far as I remember, you can't get this from PROC MIXED).

--
Paige Miller
StatsMan
SAS Super FREQ

Paige is correct.  There have been pseudo r-squares proposed for mixed models, but none have really been accepted in the statistical literature.  If someone has a reference for a good one, post it here.  

 

You can get r-squares for effects if you use type 1 statistics in a GLM, but again these r-squares are not available in a mixed model.

 

Random effects are a different story.  There have been ways proposed to evaluate the relative variation explained by each random effect in the overall error variance, if the covariance structures involved are simple.   

Kip1
Calcite | Level 5

All,

 

I want to resurrect this discussion of R-square for mixed effects models, in reference to a number of recent discussions that have surfaced re implementation of Nakagawa and Schielzeth 2013 http://dx.doi.org/10.1111/j.2041-210x.2012.00261.x   'marginal' and 'conditional' R-squares for GLMMs in the MuMIn package in R https://cran.r-project.org/web/packages/MuMIn/MuMIn.pdf

 

Is there a way to compute similar values via SAS Proc Mixed? If so, I'd like to see some code examples. The only SAS reference I have found is: Rsquare = 1-(SSResidual_Model/SSResidual_InterceptOnlyModel) which can be computed in Proc Mixed and given the interpretation "percent reduction in variance due to model'. However, I don't know if or how this relates to Nakagawa and Schielzeth.

 

Any (new) thoughts?

PaigeMiller
Diamond | Level 26

@Kip1 wrote:

All,

 

I want to resurrect this discussion of R-square for mixed effects models, in reference to a number of recent discussions that have surfaced re implementation of Nakagawa and Schielzeth 2013 http://dx.doi.org/10.1111/j.2041-210x.2012.00261.x   'marginal' and 'conditional' R-squares for GLMMs in the MuMIn package in R https://cran.r-project.org/web/packages/MuMIn/MuMIn.pdf

 

Is there a way to compute similar values via SAS Proc Mixed? If so, I'd like to see some code examples. The only SAS reference I have found is: Rsquare = 1-(SSResidual_Model/SSResidual_InterceptOnlyModel) which can be computed in Proc Mixed and given the interpretation "percent reduction in variance due to model'. However, I don't know if or how this relates to Nakagawa and Schielzeth.

 

Any (new) thoughts?


Your first link doesn't work. The second link (to the R package MuMin) doesn't really explain what MuMin does. So, no new thoughts from me.

--
Paige Miller
Kip1
Calcite | Level 5

Try this https://doi.org/10.1111/j.2041-210x.2012.00261.x

 

"A general and simple method for obtaining R^2 from GLMMs" Nakagawa and Schielzeth 2013 Methods Ecol. Evol 4: 133-142

PaigeMiller
Diamond | Level 26

Okay, that works. But as far as I know, none of this is programmed in SAS, you'd have to program it yourself, or get the R-code to work.

--
Paige Miller

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 6 replies
  • 4686 views
  • 0 likes
  • 4 in conversation