| vcov | R Documentation |
Returns the posterior covariance matrix of the main parameters of a fitted bayesics object
## S3 method for class 'aov_b'
vcov(object, ...)
## S3 method for class 'lm_b'
vcov(object, ...)
## S3 method for class 'glm_b'
vcov(object, ...)
## S3 method for class 'np_glm_b'
vcov(object, ...)
object |
a fitted model object from |
... |
Passed to methods. |
A matrix of the covariance matrix for the regression coefficients. If the posterior
is a multivariate t distribution (or consists of independent t's in the case of heteroscedastic
1-way ANOVA), the degrees of freedom are returned as the df attribute of the matrix. Note
that for lm_b and aov_b objects, this function already takes into account the
uncertainty around the residual variance.
set.seed(2025)
N = 500
test_data <-
data.frame(x1 = rnorm(N),
x2 = rnorm(N),
x3 = letters[1:5])
test_data$outcome <-
rnorm(N,-1 + test_data$x1 + 2 * (test_data$x3 %in% c("d","e")) )
fit1 <-
lm_b(outcome ~ x1 + x2 + x3,
data = test_data)
vcov(fit1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.