| r2_cor | R Documentation | 
The r2_cor function estimates a pseudo R-squared by correlating predicted \hat{Y} values and observed Y values. This pseudo R-squared is similar to the R^2 used in OLS regression. It indicates amount of variation in the outcome that is explained by the model (Peugh, 2010; Singer & Willett, 2003, p. 36).
r2_cor(x, verbose = FALSE)
x | 
 A model produced using the   | 
verbose | 
 If true, prints an explanatory message, "The squared correlation between predicted and observed values is...". If false (default), returns a value.  | 
If verbose == TRUE, a console message. If verbose == FALSE (default), a numeric value.
peugh2010mlmhelpr
\insertRefsinger2003mlmhelpr
fit <- lme4::lmer(mathach ~ 1 + ses + catholic + (1|id),
data=hsb, REML=TRUE)
# returns a numeric value
r2_cor(fit)
# returns a console message with the r2 value
r2_cor(fit, verbose = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.