3.8. Running Simulations and Power Analysis in R
Something nice here
About these materials
Welcome! This workshops is intended to provide learners with a deeper understanding of version control and practical skills to apply version control to their own workflows. Here, we will learn about tools that can help us increase the transparency of our work to ourselves and the people we work with, by tracking the changes we make to our work in a systematic manner. This way, others (and our future selves) can follow the steps and decision making process. We will also learn how to use tools to facilitate collaboration across different groups and people.
Who are these materials for?
The target audience of this workshop is twofold:
Self-learners with basic familiarity with R, RStudio and basical statistical concepts who are interested in developing their skills on the topic. You can follow the materials by chronologically going through the slides and following along the practical exercises. You go at your own pace and within your own timeframe. Speaker notes will help you to understand and reflect on the content of the materials. Note: Group exercises are not possible in this asynchronous setting.
Instructors in higher education (e.g., universities, colleges) aiming to convey the content of these materials to their learners in a synchronous (in-person, virtual or hybrid) class-room setting. The slides can be directly presented in full screen below, with presenter and instructor notes providing detailed information about the content of the materials and valuable pedagogical tips how to convey the materials to your learners. You can also download the PowerPoint corresponding to the materials below and adapt the materials to your learners. Make sure to give appropriate credit to the original authors.
Prerequisites
| Prerequisite | Description | Link/Where to find it |
|---|---|---|
| R and RStudio installed | Latest R version: ‘4.4.0+’ and RStudio version: ‘2026.01.0+392’ | Installation Link |
| R basics | e.g., how to select a value in a data frame, how to create a vector | Tutorial Link |
| Familiarity with basic statistical concepts | e.g., hypothesis testing, descriptive statistics, data analysis | Cheatsheet Link |
Learning goals
- To understand the concept of simulations
- To explain the purpose of simulations in research
- To summarize how simulations support hypothesis testing and experimentation
- To perform the simulation process in the context of a fictional experiment
- To understand the concept of power analysis
- To explain the purpose of power analysis in research
- To summarize how power analysis supports hypothesis testing and experimentation
- To successfully perform a simulation in R
Materials
Click here to see the materials in full Screen
Supplementary files
Practical exercises - solutions
Download the solutions for the practical exercises here:
Helpfiles
Download the csv file for the example data:
Export slides
You can export these slides as PowerPoint by pressing the button below. Note that basic formatting will be applied. MAKE powerpoint template to use for export.
Contributors and licence details
Creator: Sharma, Tejaswini (
0009-0000-0305-9751)
Reviewer: Von Grebmer zu Wolfsthurn, Sarah (
0000-0002-6413-3895)
Consultant: Ihle, Malika (
0000-0002-3242-5981)
This work was originally created by Malika Ihle based on materials from Joel Pick, Hadley Wickham, and Kevin Hallgren, with contributions from James Smith. This current work by Tejaswini Sharma, Sarah von Grebmer zu Wolfsthurn and Malika Ihle is licensed under a CC-BY-SA 4.0 Creative Commons Attribution 4.0 International SA License. It permits unrestricted re-use, distribution, and reproduction in any medium, provided the original work is properly cited. If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.