Skip to contents

Returns the posterior mean of the variance-covariance matrix/matrices of the random effects in a fitted JointAI object.

Usage

rd_vcov(object, outcome = NULL, start = NULL, end = NULL, thin = NULL,
  exclude_chains = NULL, mess = TRUE, warn = TRUE)

Arguments

object

object inheriting from class 'JointAI'

outcome

optional; vector of integers giving the indices of the outcomes for which the random effects variance-covariance matrix/matrices should be returned.

start

the first iteration of interest (see window.mcmc)

end

the last iteration of interest (see window.mcmc)

thin

thinning interval (integer; see window.mcmc). For example, thin = 1 (default) will keep the MCMC samples from all iterations; thin = 5 would only keep every 5th iteration.

exclude_chains

optional vector of the index numbers of chains that should be excluded

mess

logical; should messages be given? Default is TRUE.

warn

logical; should warnings be given? Default is TRUE.

Value

A list with one element per selected outcome (sub-model), each a list with one matrix per grouping level: the posterior mean of the variance-covariance matrix of the random effects, with rows and columns named by the random effects. When only one outcome is selected, the list for this outcome is returned directly.

Examples

# \donttest{
mod <- lme_imp(y ~ C1 + time + (time | id), data = longDF, n.iter = 100,
               mess = FALSE)

rd_vcov(mod)
#> $id
#>                                   y           y
#>                         (Intercept)        time
#>           y (Intercept)  14.7952025  -0.4352103
#>           y        time  -0.4352103   0.2293438
#> 
# }