Extract residual correlation structure for nlme, brms, and glmmTMB models.
extract_cor_structure(model, digits = 3, ...) # S3 method for lme extract_cor_structure(model, digits = 3, ...) # S3 method for glmmTMB extract_cor_structure( model, digits = 3, ..., component = "cond", which_cor, full_matrix = FALSE ) # S3 method for brmsfit extract_cor_structure(model, digits = 3, ..., ci_level = 0.95)
An appropriate mixed model.
Rounding. Default is 3.
Other arguments specific to the method. Unused at present.
For glmmTMB objects, which of the three components 'cond', 'zi' or 'disp' to select. Default is 'cond'.
Required for glmmTMB. Which correlation parameter to extract. Must be one of 'ar1', 'ou', 'cs', 'toep', 'diag','us', 'mat', 'gau', 'exp'.
For glmmTMB correlation, return the full residual
covariance/correlation matrix (
For brms objects, confidence level < 1, typically above 0.90. A value of 0 will not report it. Default is .95.
For nlme and glmmTMB models, a data frame of the estimates. For brms, the parameters and related uncertainty, similar to extract_fixed_effects.
This function applies to models with residual correlation, i.e. that
contain something like
corAR1(form = ~time) for nlme, or brms
models with an
autocor argument. This functions extracts the
associated parameters (e.g.
Phi in nlme,
ar in brms, etc.)
For glmmTMB objects, rather than the full matrix, simplified output is
provided by default. For
cs, a single value; for
(toeplitz) a single row/column; for
diag structures just the diagonal.
In addition, for
diag the residual variance is added to the estimates.
Most types of spatial models should work as well.