Skip to contents

This function extracts variance-covariance components from a glmmTMB model object for a specific grouping factor and returns them as a data frame.

Usage

wrapper_var_cor(var_cor, elt)

Arguments

var_cor

A variance-covariance object from the glmmTMB model.

elt

A character indicating the type of effect, either "cond" or "zi".

Value

A data frame containing the standard deviation and correlation components for the specified grouping factor.

Examples

model <- glmmTMB::glmmTMB(Sepal.Length ~ Sepal.Width + Petal.Length + (1|Species), 
                           data = iris, family = gaussian)
var_cor <- summary(model)$varcor$cond
ran_pars_df <- wrapper_var_cor(var_cor, "Species")