to_formula {mlmpower}R Documentation

Convert mp_data to a stats::formula to be used for lme4::lmer

Description

Produces the formula including the centering functions based on a data set generated with generate.

Usage

to_formula(data, nested = FALSE)

Arguments

data

the mp_data to be coerced.

nested

logical value, if true then produce the nested restricted model

Value

a stats::formula

Examples

# Specify model
model <- (
    outcome('Y')
    + within_predictor('X')
    + effect_size(
        icc = 0.2,
        within = 0.3
    )
)
# Set seed
set.seed(198723)
# Create formula based on data set
model |> generate(5, 50) |> to_formula()

[Package mlmpower version 1.0.8 Index]