I’d like to create a correlation matrix for regressors in a hierarchical model, and I’ve come across the function VarCorr.brmsfit here: https://rdrr.io/cran/brms/man/VarCorr.brmsfit.html. However, I’m unclear on what the output is exactly - does this function calculate correlations between regressor input or regression weights? Thanks, I appreciate any advice.
The keyword in the link is estimated
. The correlations are calculated between parameters not between the input data.
Executing the example in the link,
VarCorr(fit) provides.
$visit$cov
, , Intercept
Estimate Est.Error Q2.5 Q97.5
Intercept 3.6711353 9.455393 0.00225775 25.957742
Trt1 -0.7187569 5.660284 -13.24285644 4.487274
The Intercept line shows the variance and Trt1 line the covariance between Intercept and Trt1.
1 Like