Skip to contents

Variance-covariance of the fixed effects

Usage

# S3 method for class 'bqmm'
vcov(object, adjusted = TRUE, method = c("ywh", "ij"), cluster = TRUE, ...)

Arguments

object

A bqmm fit.

adjusted

Logical; if TRUE (default) return a misspecification- corrected covariance (chosen by method), otherwise the naive posterior covariance.

method

Correction to use when adjusted = TRUE: "ywh" (default) is the Yang-Wang-He posterior-covariance sandwich (compute_ywh_multiplicative()); "ij" is the Infinitesimal Jackknife (ij_vcov()). Both are cluster-robust by default for a mixed model.

cluster

Logical; use the cluster-robust form (default TRUE).

...

Unused.

Value

A K x K covariance matrix for the fixed effects.

Examples

# \donttest{
fit <- bqmm(distance ~ age + (1 | Subject), data = nlme::Orthodont,
            tau = 0.5, chains = 1, iter = 300, refresh = 0, seed = 1)
#> Warning: The largest R-hat is 1.07, indicating chains have not mixed.
#> Running the chains for more iterations may help. See
#> https://mc-stan.org/misc/warnings.html#r-hat
#> Warning: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.
#> Running the chains for more iterations may help. See
#> https://mc-stan.org/misc/warnings.html#bulk-ess
#> Warning: Tail Effective Samples Size (ESS) is too low, indicating posterior variances and tail quantiles may be unreliable.
#> Running the chains for more iterations may help. See
#> https://mc-stan.org/misc/warnings.html#tail-ess
#> Warning: Some Rhat > 1.01; chains may not have converged.
#> Warning: Some effective sample sizes < 100; consider more iterations.
vcov(fit)
#>             (Intercept)          age
#> (Intercept)  1.23465168 -0.052520479
#> age         -0.05252048  0.006596703
# }