partGaussian: Partition the R2 for Gaussian mixed models

Description Usage Arguments Value References Examples

View source: R/partGaussian.R

Description

R2, commonality coefficients and structure coefficients for gaussian lme4 models.

Usage

1
2
partGaussian(mod, partvars = NULL, R2_type = "marginal", nboot = NULL,
  CI = 0.95)

Arguments

mod

Gaussian merMod object from lme4::lmer.

partvars

Character vector specifying the predictors for which to partition the R2.

R2_type

"marginal" or "conditional"

nboot

Number of parametric bootstraps for interval estimation (defaults to NULL). Larger numbers of bootstraps give a better asymtotic CI, but may be time-consuming. Bootstrapping can be switch on by setting nboot = 1000.

CI

Width of the required confidence interval between 0 and 1 (defaults to 0.95).

Value

Returns an object of class partR2 that is a a list with the following elements:

call

model call

datatype

Response distribution (here: 'Gaussian').

R2_type

Marginal or conditional R2

R2_df

R2 and confidence interval

R2_boot

Parametric bootstrap samples for R2

CC_df

Commonality coefficients (unique and common R2) and confidence intervals

SC_df

Structure coefficients (correlation between predicted response Yhat and the predictors specified in partvars) and confidence intervals

SC_boot

Parametric bootstrap samples for the SCs

partvars

predictors to partition

CI

Coverage of the confidence interval as specified by the CI argument.

References

Nakagawa, S., & Schielzeth, H. (2013). A general and simple method for obtaining R2 from generalized linear mixed‐effects models. Methods in Ecology and Evolution, 4(2), 133-142.

Newton, R. G., & Spurrell, D. J. (1967). A development of multiple regression for the analysis of routine data. Applied Statistics. 51-64.

Examples

1
2
3
4
5
6
7
8
data(BeetlesBody)
library(lme4)
mod <- lmer(BodyL ~ Sex + Treatment + Habitat + (1|Container) + (1|Population),
            data = BeetlesBody)

R2 <- partGaussian(mod, partvars = c("Sex", "Treatment", "Habitat"),
                   R2_type = "marginal", nboot = 20, CI = 0.95)
R2

mastoffel/partR2 documentation built on May 6, 2018, 4:04 a.m.