random_effects_expr: Construct random effects formula

View source: R/mmrm.R

random_effects_exprR Documentation

Construct random effects formula

Description

Constructs a character representation of the random effects formula for fitting a MMRM for subject by visit in the format required for mmrm::mmrm().

Usage

random_effects_expr(
  cov_struct = c("us", "toep", "cs", "ar1"),
  cov_by_group = FALSE
)

Arguments

cov_struct

Character - The covariance structure to be used, must be one of "us", "toep", "cs", "ar1"

cov_by_group

Boolean - Whenever or not to use separate covariances per each group level

Details

For example assuming the user specified a covariance structure of "us" and that no groups were provided this will return

us(visit | subjid)

If cov_by_group is set to FALSE then this indicates that separate covariance matrices are required per group and as such the following will be returned:

us( visit | group / subjid )

rbmi documentation built on Nov. 24, 2023, 5:11 p.m.