Description Usage Arguments Value Author(s) References See Also
This function calculates the R-squared of a multilevel/hierarchical model following Gelman & Pardoe (2006) (see References
).
1 |
residuals |
A numeric matrix containing the residual values obtained through MCMC. |
data.level |
Logical. If TRUE, calculates the R2 at the data level (level 1) and the denominator is the variance of the data instead of variance of the parameters/linear predictors (see function definition for more details). |
responsevar |
A numeric vector. The response variable used to fit the model. Only required for data-level calculations. |
param.sims |
A numeric matrix containing the posterior samples for the random effects parameters. |
A numeric value: the r-squared
Paco, based on code by Gelman & Hill (2007) (see references
).
Gelman & Pardoe (2006) Technometrics. Gelman & Hill (2007) book
r2.multilevel
in this same package.
r.squaredGLMM
in MuMIn
package and http://jslefche.wordpress.com/2013/03/13/r2-for-linear-mixed-effects-models/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.