Repository for Vogel, D., & Willems, J. (2020). The effects of making public service employees aware of their prosocial and societal impact: A microintervention. Journal of Public Administration Research and Theory. https://doi.org/10.1093/jopart/muz044
The main repository can be found here: https://doi.org/10.17605/OSF.IO/W97H4
The codebook for the data can be found here: https://dominikvogel.github.io/helping-others-micro-intervention/
A long-term archived version of the data and code is available at https://doi.org/10.5281/zenodo.3570986
There is a Code Ocean Capsule for long-term computational reproducibility: https://doi.org/10.24433/CO.2463564.v1. See below for more information.
This GitHub repository provides another way to computationally reproduce the results using Binder. See below for more information.
You can reproduce our results and even test how changes in the code affect the results by using the Binder environment of the paper:
- Click on the "Launch Binder" badge
- Wait for the server to be started
- Open
code/Paper.Rmd
in the right panel - Click on
Knit
->Knit to pdf_document2
- Wait for a complete reproduction of the paper with all results.
You can easily reproduce our results using the free service of Code Ocean:
- Open the paper's Code Ocean Capsule: https://doi.org/10.24433/CO.2463564.v1
- Log-in to Code Ocean
- Click Re-Run
- Code Ocean runs a virtual environment and produces a PDF with the full paper including all results.
You can inspect the R code by clicking on the files in the left panel (see below for an explanation of the file structure).
If you want to reproduce our results on your own computer you need R (we used version 3.5.3) and RStudio.
- Download the
.here
file and the folderscode
anddata
- Make sure that you installed all required packages (see below for a list of required packages)
- Open
code/Paper.Rmd
in RStudio. - Press
Knit
and than selectKnit to pdf_document2
- R runs all analyses and creates the full paper as a PDF document.
- Install Docker Community Edition
- Download the
Docker-Capsule.zip
file from the OSF Project Repository and extract it - Open a Terminal and navigate to the extracted folder
- Execute the following command:
docker load --input micro-intervention.tar docker run --rm \ --workdir /code \ --volume "$PWD/data":/data \ --volume "$PWD/code":/code \ --volume "$PWD/results":/results \ micro-intervention run
The repository consists of some files in the root folder and two folders.
.here
is an empty file that helps thehere
package to set the right working directory in R./data
contains the data of the paper in three CSV files:Study1_public.csv
: Data for Study 1Study2_public.csv
: Data for Study 2Study3_public.csv
: Data for Study 3
/code
contains all scripts and files necessary to reproduce the results:Paper.Rmd
: main file containing the text of the paper and loads all analyses.Paper_functions.R
: Custom functionsPaper_s1.R
: Analysis code for Study 1Paper_s2.R
: Analysis code for Study 2Paper_s3.R
: Analysis code for Study 3Paper_BF.R
: Code to calculate Bayes factorsPaper_forestplot_prosocial.R
: Code to create left part of Figure 5Paper_forestplot_societal.R
: Code to create right part of Figure 5Bibliography.bib
: References used in the paper (in BibTeX format)chicago-author-date.csl
: Defines references stylelatex_template.tex
: LaTeX template for the PDF documentCONSORT.pdf
: CONSORT flow chart of Study 1 for the AppendixCONSORT2.pdf
: CONSORT flow chart of Study 2 for the AppendixCONSORT3.pdf
: CONSORT flow chart of Study 3 for the Appendixforestplot_combined.pdf
: Figure 5 (merge of figures created byPaper_forestplot_prosocial.R
andPaper_forestplot_societal.R
- apaTables
- BayesFactor
- bookdown
- broman
- cowplot (<= 0.9.4)
- dplyr
- effsize
- ez
- forestplot
- ggsignif
- here
- knitr
- MBESS
- nlme
- psych
- rlang
- rmarkdown
- sjstats
- stargazer
- stats
- tibble
- tidyverse
- weights
- xtable
It is advised to use R
version 3.5.3 with the checkpoint
package and set the date to 2019-04-01 to ensure that the package versions are comparable:
library(checkpoint)
checkpoint("2019-04-01")