knitr::opts_chunk$set(
  collapse = TRUE,
  warning = FALSE,
  message = FALSE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
set.seed(8675309)

Data Simulation Workshop Materials {style="float:right; width:200px;"}

Being able to simulate data allows you to:

Installation

You can install the packages used in these tutorials and get a function that makes it easy to access the workshop .Rmd files by running the following code:

devtools::install_github("debruine/data-sim-workshops")

Then you can load exercises with the following code:

dsw::exercise("faux")
dsw::exercise("calories")
dsw::exercise("fixed")
dsw::exercise("mixed")

Alternatively, download the stub files and install the specific packages for your workshop.

Upcoming Workshops

When: 2024 February 1-2 Where: Data Simulation Workshop 2024, Institute of Psychology, Bern, Switzerland

Data Simulation with {faux}

This session will cover the basics of simulation using {faux}. We will simulate data with factorial designs by specifying the within and between-subjects factor structure, each cell mean and standard deviation, and correlations between cells where appropriate. This can be used to create simulated data sets to be used in preparing the analysis code for pre-registrations or registered reports. We will also create data sets for simulation-based power analyses. Students will need to have very basic knowledge of R and R Markdown, and have installed {faux}, {afex}, {broom} and {tidyverse}.

Prep

Data simulation for mixed designs

This session will cover simulating data for a mixed design, where trials are crossed with subjects. We will learn how to analyse this using {lme4}, with a focus on understanding how the simulation parameters correspond to the output. Finally, we will learn how to use simulation to calculate power. Students will need to have basic knowledge of R and R Markdown, some familiarity with mixed designs (even if they don't currently analyse them with mixed models) and have installed {faux}, {afex}, {tidyverse}, and {lme4}.

Prep

Resources

Past Workshops



debruine/data-sim-workshops documentation built on April 27, 2024, 8:13 a.m.