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.

Examples

# Linear mixed model with heteroscedastic residuals
mod <- galamm(
  formula = y ~ x + (1 | id),
  dispformula = ~ (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