r.squared.glmm: Marginal and conditional r-squared for glmm given fixed and...

View source: R/rsquaredglmm.R

r.squared.glmmR Documentation

Marginal and conditional r-squared for glmm given fixed and random variances

Description

This function is based on Nakagawa and Schielzeth (2013). It returns the marginal and conditional r-squared, as well as the AIC for each glmm. Users should call the higher-level generic "r.squared", or implement a method for the corresponding class to get varF, varRand and the family from the specific object

Usage

## S3 method for class 'glmm'
r.squared(
  varF,
  varRand,
  varResid = NULL,
  varDisp = NULL,
  family,
  link,
  mdl.aic,
  mdl.class,
  null.fixef = NULL
)

Arguments

varF

Variance of fixed effects

varRand

Variance of random effects

varResid

Residual variance. Only necessary for "gaussian" family

family

family of the glmm (currently works with gaussian, binomial and poisson)

link

model link function. Working links are: gaussian: "identity" (default); binomial: "logit" (default), "probit"; poisson: "log" (default), "sqrt"

mdl.aic

The model's AIC

mdl.class

The name of the model's class

null.fixef

Numeric vector containing the fixed effects of the null model. Only necessary for "poisson" family

Value

A data frame with "Class", "Family", "Marginal", "Conditional", and "AIC" columns


Sz-Tim/sevcheck documentation built on Feb. 1, 2024, 12:39 a.m.