vcov.lmm: Extract The Variance-Covariance Matrix From a Linear Mixed...

View source: R/vcov.R

vcov.lmmR Documentation

Extract The Variance-Covariance Matrix From a Linear Mixed Model

Description

Extract the variance-covariance matrix of the model coefficients of a linear mixed model.

Usage

## S3 method for class 'lmm'
vcov(
  object,
  effects = NULL,
  robust = FALSE,
  df = FALSE,
  strata = NULL,
  newdata = NULL,
  p = NULL,
  type.information = NULL,
  transform.sigma = NULL,
  transform.k = NULL,
  transform.rho = NULL,
  transform.names = TRUE,
  ...
)

Arguments

object

a lmm object.

effects

[character vector] Should the variance-covariance matrix for all coefficients be output ("all"), or only for coefficients relative to the mean ("mean" or "fixed"), or only for coefficients relative to the variance structure ("variance"), or only for coefficients relative to the correlation structure ("correlation"). Can also contain "gradient" to also output the gradient of the Variance-Covariance matrix .

robust

[logical] Should robust standard errors (aka sandwich estimator) be output instead of the model-based standard errors. Can also be 2 compute the degrees-of-freedom w.r.t. robust standard errors instead of w.r.t. model-based standard errors.

df

[logical] Should degrees-of-freedom, computed using Satterthwaite approximation, for the model parameters be output.

strata

[character vector] When not NULL, only output the variance-covariance matrix for the estimated parameters relative to specific levels of the variable used to stratify the mean and covariance structure.

newdata

[data.frame] dataset relative to which the information should be computed. Only relevant if differs from the dataset used to fit the model.

p

[numeric vector] value of the model coefficients at which to evaluate the variance-covariance matrix. Only relevant if differs from the fitted values.

type.information

[character] Should the expected information be used (i.e. minus the expected second derivative) or the observed inforamtion (i.e. minus the second derivative).

transform.sigma

[character] Transformation used on the variance coefficient for the reference level. One of "none", "log", "square", "logsquare" - see details.

transform.k

[character] Transformation used on the variance coefficients relative to the other levels. One of "none", "log", "square", "logsquare", "sd", "logsd", "var", "logvar" - see details.

transform.rho

[character] Transformation used on the correlation coefficients. One of "none", "atanh", "cov" - see details.

transform.names

[logical] Should the name of the coefficients be updated to reflect the transformation that has been used?

...

Not used. For compatibility with the generic method.

Details

For details about the arguments transform.sigma, transform.k, transform.rho, see the documentation of the coef.lmm function.

Value

A matrix with one column and column per parameter.

  • df=TRUE: with an attribute "df" containing a numeric vector with one element per parameter.

  • effects includes "gradient": with an attribute "gradient" containing a 3 dimensional array with dimension the number of parameters.


bozenne/repeated documentation built on July 16, 2025, 11:16 p.m.