View source: R/simulation_functions.R
power_simulation | R Documentation |
power_simulation()
runs the actual simulation process for either the
databased, SESOI, R2, safeguard or rnorm power option. Returns a data frame with results
for all fixed effects and all tested sample sizes.
power_simulation(
model,
data,
simvar,
fixed_effects,
critical_value,
steps,
n_sim,
confidence_level,
safeguard = F,
rnorm = F,
R2 = F,
R2var,
R2level,
nCores
)
model |
lme4 model: mixed model of interest |
data |
data frame: pilot data that fits the mixed model of interest |
simvar |
charackter element: name of the variable that contains the subject??s number in data |
fixed_effects |
vector of character elements: names of variables that are used as fixed effects in model emp |
critical_value |
integer: z/t value to test if a given fixed effect is significant |
n_sim |
integer: number of simulations to run |
safeguard |
logical value: indicates whether safeguard power simulation shoul be run |
rnorm |
logical value: indicates whether rnorm power simulation shoul be run |
R2 |
logical value: indicating if a R2 simulation should be run |
R2var |
character: name of second random effect we want to vary |
R2level |
integer: number of levels for R2var. Right now, the second random effect can only be changed to a fixed value and not be varied like simvar |
nCores |
number of cores to use in simulation process. |
sampe_sizes |
vector of integers: sample sizes you want to test power of |
A modified mixed model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.