sim_formula: Create a simulation formula

Description Usage Arguments Details Value See Also Examples

Description

Create a simulation formula

Usage

1
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.

Details

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

Value

Object with class plcp_sim_formula

See Also

sim_formula_compare, transform_to_posttest

Examples

1
2
3
4
5
6
7
# 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")

powerlmm documentation built on May 2, 2019, 3:10 a.m.