Skip to content

lmu-osc/Introduction-Simulations-in-R

Repository files navigation

Introduction to Simulations in R

About this work

This tutorial was created by Malika Ihle based on materials from Joel Pick, Hadley Wickham, and Kevin Hallgren, with contributions from James Smith.
It is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Prerequisites

Prior to the session: optional preparation to get familiarised with the subject

  1. Watch this 30-minute introduction to credible research, which contextualises the importance of simulations for reliable research.

  2. Read Hallgren, A. K. (2013). Conducting simulation studies in the R programming environment. Tutorials in Quantitative Methods for Psychology, 9(2), 43–60.

Self-paced workshop

How it works

The self-paced tutorial (pages linked below) will alternate presentation of concepts and simple exercises for you to try to apply them in R. Each time you see written YOUR TURN, switch to your local copy of the exercise script (you can choose between a file with or without the solutions depending on e.g. your level of familiarity with R), review the examples if needed, complete the exercise, and check out the proposed answer (which often contains additional tips). Come back to the online tutorial and after finishing one page, you can navigate to the next page linked at the bottom to continue. The exercise script contains code for all the exercises and code that generates the plots that appear in the online tutorial, all in order of appearance in the tutorial.

It is necessary that you work through the sections of the tutorial in order. Please read the blurbs of each section below to get an overview of this workshop. Then click on the first page 'Download the material' and follow along by navigating to the next page linked at the bottom of each page! You can get back to this overview at any time by clicking on the title 'Introduction-Simulations-in-R' at the top of each page.

Tutorial