This function runs powerSim over a range of sample sizes.
powerSim
powerCurve(fit, test = fixed(getDefaultXname(fit)), sim = fit, along = getDefaultXname(fit), within, breaks, seed, fitOpts = list(), testOpts = list(), simOpts = list(), ...)
a fitted model object (see doFit).
doFit
specify the test to perform. By default, the first fixed effect in fit will be tested. (see: tests).
fit
an object to simulate from. By default this is the same as fit (see doSim).
doSim
the name of an explanatory variable. This variable will have its number of levels varied.
names of grouping variables, separated by "+" or ",". Each combination of groups will be extended to n rows.
n
number of levels of the variable specified by along at each point on the power curve.
along
specify a random number generator seed, for reproducible results.
extra arguments for doFit.
extra arguments for doTest.
doTest
extra arguments for doSim.
any additional arguments are passed on to simrOptions. Common options include:
simrOptions
nsim
the number of simulations to run (default is 1000).
1000
alpha
the significance level for the statistical test (default is 0.05).
0.05
progress
use progress bars during calculations (default is TRUE).
TRUE
print.powerCurve, summary.powerCurve, confint.powerCurve
print.powerCurve
summary.powerCurve
confint.powerCurve
# NOT RUN { fm <- lmer(y ~ x + (1|g), data=simdata) pc1 <- powerCurve(fm) pc2 <- powerCurve(fm, breaks=c(4,6,8,10)) print(pc2) plot(pc2) # } # NOT RUN { # }
Run the code above in your browser using DataLab