Skip to contents

Calculate variance-covariance matrix for GALAMM fit

Usage

# S3 method for class 'galamm'
vcov(object, parm = "beta", ...)

Arguments

object

Object of class galamm returned from galamm.

parm

The parameters for which the variance-covariance matrix should be calculated. Character vector with one or more of the elements "theta", "beta", "lambda", and "weights". Can also be an integer vector. When given as a character, it must be in only lowercase letters.

...

Further arguments passed on to other methods. Currently not used.

Value

A variance-covariance matrix.

See also

confint.galamm() for the method computing confidence intervals. See vcov() for the generic function.

Other details of model fit: VarCorr(), coef.galamm(), confint.galamm(), deviance.galamm(), factor_loadings.galamm(), family.galamm(), fitted.galamm(), fixef(), formula.galamm(), llikAIC(), logLik.galamm(), nobs.galamm(), predict.galamm(), print.VarCorr.galamm(), ranef.galamm(), residuals.galamm(), response(), sigma.galamm()

Examples

# Linear mixed model with heteroscedastic residuals
mod <- galamm(
  formula = y ~ x + (1 | id),
  weights = ~ (1 | item),
  data = hsced
)

# Extract covariance matrix for fixed regression coefficients
vcov(mod, parm = "beta")
#>              [,1]         [,2]
#> [1,]  0.009841573 -0.007511908
#> [2,] -0.007511908  0.014715234

# and then for weights, which gives us the variance.
vcov(mod, parm = "weights")
#>             [,1]
#> [1,] 0.002459613