1 + 1
[1] 2
Now that you know how to simulate data and data analyses to
check alpha so your models don’t yield more than 5% false-positive results
check beta (power) for easy tests such as t-tests (where this isn’t really needed)
prepare a preregistration and make sure your code works
check your understanding of statistics
Let’s dive deeper into power calculations for different complex models.
For each, we will follow the structure:
define what type of data and variables need to be simulated, i.e. their distribution, their class (e.g. factor vs numerical value), sample sizes (within a dataset, and number of replicates), what will need to vary (e.g. the strength of relationship)
generate data, random data or data including an effect (e.g. an imposed correlation between two variables)
run the statistical test you think is appropriate, and record the relevant statistic (e.g. p-value)
replicate step 2 and 3 to get the distribution of the statistic of interest
try out different parameter sets (explore the parameter space for which results are similar)
analyze and interpret the combined results of many simulations within each set of parameters. For instance, check that you only get a significant result in 5% of the simulations (if alpha = 0.05
) when you simulated no effect; and that you get at a significant result in 80% of the simulations (if you targeted a power
of 80%) when you simulated an effect
Here are the type of models we will cover, you can pick and choose what is relevant to you!
[LM](LM.qmd)
GLM
LMM
GLMM
SEM
1 + 1
[1] 2