Learn R Programming

powerlmm (version 0.4.0)

sim_formula: Create a simulation formula

Description

Create a simulation formula

Usage

sim_formula(formula, data_transform = NULL, test = "time:treatment")

Arguments

formula

A character containing a lme4 formula.

data_transform

Optional; a function that applies a transformation to the data during each simulation.

test

A character vector indicating which parameters should be tested. Only applies to tests using Satterthwaite dfs, or when calculating confidence intervals.

Value

Object with class plcp_sim_formula

Details

It is possible to fit model without any random effects. If no random effects is specified the model is fit using lm().

See Also

sim_formula_compare, transform_to_posttest

Examples

Run this code
# NOT RUN {
# 2-lvl model
f <- sim_formula("y ~ treatment * time + (1 + time | subject)")

# ANCOVA using 'data_transform'
f <- sim_formula("y ~ treatment + pretest",
                 data_transform = transform_to_posttest,
                 test = "treatment")

# }

Run the code above in your browser using DataLab