turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Calculate R2 for mixed models: Nakagawa and Schie...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-07-2015 09:49 AM

Is it possible in any of the mixed model programs to calculate an R2 using the recently published Nakagawa and Schielzeth 2013 (Methods in Ecology and Evolution) formula? I have a very large mixed model, and I'd rather not calculate it by hand... Thanks!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-08-2015 12:51 PM

Could you provide the formula? We can probably figure out the correct ODS files to get what is needed, and it is then just a DATA step program.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-14-2015 08:18 AM

Apologies for my delayed reply! I replied to the email, but I don't think you received it? My email is below:

Steve,

Excellent!! You have made my day! I can actually do you one better and provide the papers which give the complete formulations (and their derivations). The Nakagawa and Schielzeth paper is attached as well as the update by Johnson which applies to random slopes as well as random intercept models. Both papers also provide R code (which I have also attached) if that helps as well.

My ultimate goal is to calculate the variation explained by the some of the fixed effects in my model, and the r2 is the first step.

Thank you!!!

Alison

P.S. I couldn't attach any files so here are the weblinks:

Johnson 2014: http://onlinelibrary.wiley.com/doi/10.1111/2041-210X.12225/epdf

Johnson 2014 R code: http://onlinelibrary.wiley.com/store/10.1111/2041-210X.12225/asset/supinfo/mee312225-sup-0001-RScrip...

Nakagawa & Schielzeth 2013: http://onlinelibrary.wiley.com/doi/10.1111/j.2041-210x.2012.00261.x/epdf

Nakagawa & Schielzeth 2013 R code: http://onlinelibrary.wiley.com/store/10.1111/j.2041-210x.2012.00261.x/asset/supinfo/mee3261-sup-0004...

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-14-2015 08:52 AM

It looks like what is needed are several runs to get what is needed. I have tried to match the R objects in the Nakagawa&Schielzeth R code paper to what I think you need from SAS output:

VarF: Residual error from a fixed effects only design

the various VarCorr estimates are obtained as the variance components of the random effects.

Marginal Rsq is then VarF/Sum (VarF + all VarCorrs + residual error variance)

Conditional Rsq is Sum(VarF + all VarCorrs)/Sum ( VarF + all VarCorrs + residual error variance)

You can get all of these using ODS output. The table name is CovParms.in all of the mixed model procedures I am familiar with.

The only drawback I see to this approach is that I would have a hard time extending this beyond a simple variance component approach. Once structured covariances enter the picture, the various components are not necessarily strictly additive--any correlation type parameters would mean that there is some sort of shrinkage not necessarily correctly accounted for, so that these Rsq values would be inflated.

Steve Denham