Description Usage Arguments Value Note See Also Examples
Calculate the R2, also known as the coefficient of determination, value for different model objects. Depending on the model, R2, pseudoR2, or marginal / adjusted R2 values are returned.
1 2 3 4 5 6 7 
model 
A statistical model. 
... 
Arguments passed down to the related r2methods. 
ci 
Confidence Interval (CI) level. Default is 
ci_method 
Method for constructing the R2 confidence interval.
Options are 
verbose 
Logical. Should details about R2 and CI methods be given ( 
tolerance 
Tolerance for singularity check of random effects, to decide
whether to compute random effect variances for the conditional rsquared
or not. Indicates up to which value the convergence result is accepted. When

Returns a list containing values related to the most appropriate R2
for the given model (or NULL
if no R2 could be extracted). See the
list below:
Logistic models: Tjur's R2
General linear models: Nagelkerke's R2
Multinomial Logit: McFadden's R2
Models with zeroinflation: R2 for zeroinflated models
Mixed models: Nakagawa's R2
Bayesian models: R2 bayes
If there is no r2()
method defined for the given model class,
r2()
tries to return a "generic r2 value, calculated as following:
1sum((yy_hat)^2)/sum((yy_bar)^2))
r2_bayes()
, r2_coxsnell()
, r2_kullback()
,
r2_loo()
, r2_mcfadden()
, r2_nagelkerke()
,
r2_nakagawa()
, r2_tjur()
, r2_xu()
and
r2_zeroinflated()
.
1 2 3 4 5 6 7 
$R2_Tjur
Tjur's R2
0.4776926
Loading required package: lme4
Loading required package: Matrix
# R2 for mixed models
Conditional R2: 0.969
Marginal R2: 0.658
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.