Learn R Programming

simr (version 1.0.0)

powerSim: Estimate power by simulation.

Description

Perform a power analysis for a mixed model.

Usage

powerSim(fit, test = fixed(getDefaultXname(fit)), sim = fit,
  fitOpts = list(), testOpts = list(), simOpts = list(), seed, ...)

Arguments

fit
a fitted model object (see doFit).
test
specify the test to perform. By default, the first fixed effect in fit will be tested. (see: tests).
sim
an object to simulate from. By default this is the same as fit (see doSim).
fitOpts
extra arguments for doFit.
testOpts
extra arguments for doTest.
simOpts
extra arguments for doSim.
seed
specify a random number generator seed, for reproducible results.
...
any additional arguments are passed on to simrOptions. Common options include: [object Object],[object Object],[object Object]#'

Examples

Run this code
fm1 <- lmer(y ~ x + (1|g), data=simdata)
powerSim(fm1, nsim=10)

Run the code above in your browser using DataLab