Resources
Follow-up self-paced tutorial on simulation of data analyses for advanced power analyses
Hallgren 2013
The article suggested for getting familiarised with the topic prior to the session, i.e. Hallgren A. K. 2013. Conducting simulation studies in the R programming environment. Tutor Quant Methods Psychol. ; 9(2): 43–60, contains accompanying R scripts and CSV data files which you can peruse in the Hallgren2013 folder of this repository. It contains:
Annotated R syntax file for Example 1: “novel question.R”
Annotated R syntax file for Example 2: “power analysis.R”
Annotated R syntax file for Example 3: “bootstrapping.R”
CSV dataset generated in Example 1, which is also used later in Example 2: “novel_question_output.csv”
CSV dataset used in Example 3: “mediation_raw_data.csv”
Other articles
Depending on the type of simulation that would be useful for you, these articles may be of interest:
Johnson, P.C.D., Barry, S.J.E., Ferguson, H.M. and Müller, P. (2015). Power analysis for generalized linear mixed models in ecology and evolution. Methods Ecol Evol, 6: 133-142. https://doi.org/10.1111/2041-210X.12306
Blanco, David, et al (2020). “Effect of an editorial intervention to improve the completeness of reporting of randomised trials: a randomised controlled trial.” BMJ open 10.5: e036799. https://doi.org/10.1136/bmjopen-2020-036799
- In the “Power analysis” section, there is a simple example of a power simulation. R code is provided in the supplementary material.
Getting started simulating data in R: some helpful functions and how to use them. https://aosmith.rbind.io/2018/08/29/getting-started-simulating-data/
- This blog gives a great overview of how to start simulating more complex datasets, including step by step explanations of relevant R functions
Prive, F., Aschard, H., Ziyatdinov, A. and Blum, M.G.B. (2018). Efficient analysis of large-scale genome-wide data with two R packages: bigstatsr and bigsnpr. Bioinformatics, 34(16), 2018, 2781–2787. https://doi.org/10.1093/bioinformatics/bty185
Ronnegard, L., et al. (2016). Increasing the power of genome wide association studies in natural populations using repeated measures – evaluation and implementation. Methods in Ecology and Evolution 2016, 7, 792–799. https://doi.org/10.1111/2041-210X.12535
Dalpiaz, D. (2020) Applied Statistics with R, Chapter 7 Simple Linear Regression, section 6 Simulating SLR. https://daviddalpiaz.github.io/appliedstats/simple-linear-regression.html#simulating-slr
use of R packages to run simulations
https://cran.r-project.org/web/packages/simstudy/vignettes/simstudy.html
https://cran.r-project.org/web/packages/simglm/vignettes/tidy_simulation.html