varcomp_vcov: Estimated sampling variance-covariance of variance component...

View source: R/information-matrices.R

varcomp_vcovR Documentation

Estimated sampling variance-covariance of variance component parameters.

Description

Estimate the sampling variance-covariance of variance component parameters from a fitted linear mixed effects model (lmeStruct object) or generalized least squares model (glsStruct object) using the inverse Fisher information.

Usage

varcomp_vcov(mod, type = "expected", separate_variances = FALSE)

Arguments

mod

Fitted model of class lmeStruct or glsStruct.

type

Type of information matrix. One of "expected" (the default), "observed", or "average".

separate_variances

Logical indicating whether to return the Fisher information matrix for separate level-1 variance components if using varIdent function to allow for different variances per stratum. Default is FALSE.

Value

Sampling variance-covariance matrix corresponding to variance component parameters of mod.

Examples


library(nlme)
data(Bryant2016)
Bryant2016_RML <- lme(fixed = outcome ~ treatment,
                      random = ~ 1 | school/case,
                      correlation = corAR1(0, ~ session | school/case),
                      data = Bryant2016)
varcomp_vcov(Bryant2016_RML, type = "expected")

Bryant2016_RML2 <- lme(fixed = outcome ~ treatment,
                      random = ~ 1 | school/case,
                      correlation = corAR1(0, ~ session | school/case),
                      weights = varIdent(form = ~ 1 | treatment),
                      data = Bryant2016)
varcomp_vcov(Bryant2016_RML2, separate_variances = TRUE)


lmeInfo documentation built on April 17, 2023, 9:08 a.m.