Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/debruine/data-sim-workshops

Data simulation workshop materials and associated R package
https://github.com/debruine/data-sim-workshops

r simulation

Last synced: 21 days ago
JSON representation

Data simulation workshop materials and associated R package

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
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 ![](man/figures/logo.png){style="float:right; width:200px;"}

Being able to simulate data allows you to:

* prep analysis scripts for pre-registration
* calculate power and sensitivity for analyses that don't have empirical methods
* create reproducible examples when your data are too big or confidential to share
* enhance your understanding of statistical concepts
* create demo data for teaching and tutorials

## 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:

```{r, eval = FALSE}
devtools::install_github("debruine/data-sim-workshops")
```

Then you can load exercises with the following code:

```{r, eval = FALSE}
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.

* [faux-stub.Rmd](https://raw.githubusercontent.com/debruine/data-sim-workshops/master/inst/stubs/faux-stub.Rmd)
* [calories-stub.Rmd](https://raw.githubusercontent.com/debruine/data-sim-workshops/master/inst/stubs/calories-stub.Rmd)
* [fixed-stub.Rmd](https://raw.githubusercontent.com/debruine/data-sim-workshops/master/inst/stubs/fixed-stub.Rmd)
* [mixed-stub.Rmd](https://raw.githubusercontent.com/debruine/data-sim-workshops/master/inst/stubs/mixed-stub.Rmd)

## Upcoming Workshops

When: 2024 February 1-2
Where: [Data Simulation Workshop 2024](https://kogpsy.github.io/datasimulationcourse_24/), 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

* Install R packages from CRAN: `tidyverse`, `afex`, `faux`, and `broom`
* Download files: [faux-stub.Rmd](https://raw.githubusercontent.com/debruine/data-sim-workshops/master/inst/stubs/faux-stub.Rmd)

### 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

* Install R packages from CRAN: `tidyverse`, `afex`, `lme4`, `broom`, `broom.mixed`, `faux`
* Download files: [mixed-stub.Rmd](https://raw.githubusercontent.com/debruine/data-sim-workshops/master/inst/stubs/mixed-stub.Rmd)

## Resources

* [Faux Shiny App](https://rstudio-connect.psy.gla.ac.uk/faux/)
* [Data Skills for Reproducible Research](https://psyteachr.github.io/reprores/) open source textbook introducing tidyverse for psychologists
* [Understanding mixed effects models through data simulation](https://osf.io/3cz2e/) (preprint, code, and shiny apps)
* [Simulate Basic Distributions](https://rstudio-connect.psy.gla.ac.uk/simulate/)

## Past Workshops

* Vrije Universiteit Amsterdam, NL
Fake It Until You Make It: How and why to simulate research data
2023 September 20

* Max Planck Institute for Evolutionary Anthropology, Leipzig, Germany
Simulating data with {faux}
2023 July 27 9:00 - 12:00 (CET)

* [European Evolutionary Biology Conference](https://www.empseb28.com/workshops), Millport, Scotland
Fake It Until You Make It: How and why to simulate research data
2023 June 1 14:30 - 16:30 (GMT)

* University of Glasgow Institute of Neuroscience & Psychology
Data Simulation with {faux}
2023 January 18 12:00 - 13:00 (GMT)

* Netherlands Institute for the Study of Crime and Law Enforcement
Data Simulation with {faux}
2022 December 6 13:00 - 14:00 (CET)

* Polish Association of Social Psychology Conference, Gdánsk
Data simulation for fixed effects
Data simulation for mixed designs
Practical Session
2022 September 14 09:00 - 16:00 (CET)

* [RLadies Glasgow](https://www.meetup.com/rladies-glasgow/events/285942871/)
Data simulation using faux
2022 May 24 15:00-17:00 (BST)

* University of York
Data simulation for factorial designs
Data simulation for mixed designs
2022 April 27 09:00-17:00 (BST)

* [From Proposal to Publication: Pathways to Open Science](https://www.dropbox.com/s/aydsuk6eahxumzu/OSW-Jul21.pdf?dl=0)
Data simulation for factorial designs
Data simulation for mixed designs
2022 July 13 13:30-17:00

* University of Glasgow
Institute of Neuroscience and Psychology
2020 Jan 28 13:00-15:00 and Feb 5 14:00-16:00

* University of Grenoble
Understanding Mixed-Effects Models through Data Simulation
2021 February 5 13:00-15:00

* [PsyPAG Data Simulation Summer School](https://simsummerschool.github.io/)
Simulation for factorial designs with faux
2021 June 4 13:00-15:00