Skip to contents

Create a random effects covariance parameter object for use with other functions.

Usage

randcov_params(..., nm)

Arguments

...

A named vector (or vectors) whose names represent the name of each random effect and whose values represent the variance of each random effect. If unnamed, nm is used to set names.

nm

A character vector of names to assign to ....

Value

A named numeric vector of random effect covariance parameters.

Details

Names of the random effects should match eligible names given to random in modeling functions. While with the random argument to these functions, an intercept is implicitly assumed, with randcov_params, an intercept must be explicitly specified. That is, while with random, x | group is shorthand for (1 | group) + (x | group), with randcov_params, x | group implies just x | group, which means that if 1 | group is also desired, it must be explicitly specified.

Examples

randcov_params(group = 1, subgroup = 2)
#>    group subgroup 
#>        1        2 
randcov_params(1, 2, nm = c("group", "subgroup"))
#>    group subgroup 
#>        1        2 
# same as
randcov_params("1 | group" = 1, "1 | subgroup" = 2)
#>    1 | group 1 | subgroup 
#>            1            2