
Build default random effects formula string
Source:R/utils-formulas.R
build_default_random_effects.RdGrouping variables can be supplied explicitly; when NULL the function
falls back to common SCED name patterns and, for the within-case grouping,
to structure-based detection (non-numeric column with 2-20 levels).
Usage
build_default_random_effects(
model_data,
scd_type,
case_var = NULL,
nest_var = NULL,
study_var = NULL
)Arguments
- model_data
A data frame used for model fitting.
- scd_type
A string indicating the SCD design type (e.g.,
"reversal","changing_criterion","multiple_baseline").- case_var, nest_var, study_var
Optional column names for the case-level grouping, the within-case grouping (e.g., behavior, skill, task), and the study-level grouping. Each defaults to
NULL(auto-detect).