get_fixed_effects_structure: Get the Expected Fixed-Effects Structure

View source: R/utils.R

get_fixed_effects_structureR Documentation

Get the Expected Fixed-Effects Structure

Description

Analyzes a model formula and a design object to generate a template for the fixed_effects parameter. This is a helper function designed to prevent typos and ensure all necessary coefficients are specified. By default, this function prints a copy-paste-able code snippet to the console, where the user only needs to fill in placeholders (...) for the values.

Usage

get_fixed_effects_structure(formula, design)

Arguments

formula

An lme4-style model formula (e.g. outcome ~ predictor1 * predictor2 + (1 | id)). Since this function only uses the fixed-effects part of the model, specifying the random effects is optional here.

design

A PowRPriori_design object created with define_design().

Value

Invisibly returns a named list with placeholders, which can be used as a template for the fixed_effects argument in power_sim().

Examples

design <- define_design(
  sample_size = list(subject = 20),
  between = list(group = c("Control", "Treatment")),
  within = list(time = c("pre", "post"))
)
get_fixed_effects_structure(y ~ group * time, design)

PowRPriori documentation built on May 12, 2026, 5:06 p.m.