Introduction to simulations and power analysis in R

Explore experiments before running them.

Click here to see the materials in full screen

About these materials

Please cite these materials as: Sharma, T., Ihle, M., & Von Grebmer Zu Wolfsthurn, S. (2026). Introduction to simulations and power analysis in R [Quarto slides]. LMU Open Science Center. https://lmu-osc.github.io/teaching-material-for-novices/open-research-tools/simulations

Welcome! This workshop is intended to introduce the principles and practical use of simulations in research using R. Learners will first get familiar with what simulations are and why they are widely used in scientific research, including how they help researchers explore statistical behavior, test assumptions, and design studies before collecting real data. The workshop will also introduce power analysis, explaining how to determine appropriate sample sizes for experiments. Through a subsequent self-paced practical tutorial, learners will work through the full simulation workflow in R, including generating random data, repeating simulations, and analyzing results.

Who are these materials for?

  • Educators in higher education with or without familiarity with open research planning to teach open research to novices
  • Self-learners with no or limited familiarity with open research planning to develop and build up on their open research skills

Prerequisites

Prerequisite Description Link/Where to find it
R and RStudio installed Latest versions of both R and RStudio Download RStudio
R basics e.g., how to select a value in a data frame, how to create a vector OSC tutorial link
Familiarity with basic statistical concepts e.g., hypothesis testing, descriptive statistics, data analysis Cheatsheet Link

Learning objectives

At the end of this session, you or your learners will be able to …

  • Understand the concept of simulations
  • Explain the purpose of simulations in research
  • Summarize how simulations support hypothesis testing and experimentation
  • Perform the simulation process in the context of a fictional experiment
  • Understand the concept of power analysis
  • Explain the purpose of power analysis in research
  • Summarize how power analysis supports hypothesis testing and experimentation
  • Successfully perform a simulation in R

Download materials

Access the self-paced tutorial here: https://lmu-osc.github.io/Introduction-Simulations-in-R/.

Export slides

You can export these slides as MS PowerPoint (.pptx - in progress) or pdf by clicking below. Note that basic formatting will be applied to the PowerPoint file.

Download slides as PDF

Supplementary files

Download the activity sheet

Contributors and licence details

Creator: Sharma, Tejaswini (orcid logo0009-0000-0305-9751)

Consultant: Ihle, Malika (orcid logo0000-0002-3242-5981)

Reviewer: Von Grebmer zu Wolfsthurn, Sarah (orcid logo0000-0002-6413-3895)


Creative Commons Attribution 4.0 SA

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, Malika Ihle and Sarah von Grebmer zu Wolfsthurn is licensed under a Creative Commons Attribution 4.0 International SA License (CC-BY-SA 4.0). Code snippets are dedicated to the public domain and licensed under a Creative Commons Universal License (CC0 1.0).

Back to top