The effects of making public service employees aware of their prosocial and societal impact
Repository for Vogel, D., & Willems, J. (2019). The effects of making public service employees aware of their prosocial and societal impact: A micro-intervention. Journal of Public Administration Research and Theory.
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
code/Paper.Rmdin the right panel
- Click on
Knit to pdf_document2
- Wait for a complete reproduction of the paper with all results.
Using Code Ocean
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).
On your own machine (using your own R installation)
If you want to reproduce our results on your own computer you need R (we used version 3.5.3) and RStudio.
- Download the
.herefile and the folders
- Make sure that you installed all required packages (see below for a list of required packages)
Knitand than select
Knit to pdf_document2
- R runs all analyses and creates the full paper as a PDF document.
On your own machine (using Docker)
- Install Docker Community Edition
- Download the
Docker-Capsule.zipfile 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.
.hereis an empty file that helps the
herepackage to set the right working directory in R.
/datacontains the data of the paper in three CSV files:
Study1_public.csv: Data for Study 1
Study2_public.csv: Data for Study 2
Study3_public.csv: Data for Study 3
/codecontains 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 functions
Paper_s1.R: Analysis code for Study 1
Paper_s2.R: Analysis code for Study 2
Paper_s3.R: Analysis code for Study 3
Paper_BF.R: Code to calculate Bayes factors
Paper_forestplot_prosocial.R: Code to create left part of Figure 5
Paper_forestplot_societal.R: Code to create right part of Figure 5
Bibliography.bib: References used in the paper (in BibTeX format)
chicago-author-date.csl: Defines references style
latex_template.tex: LaTeX template for the PDF document
CONSORT.pdf: CONSORT flow chart of Study 1 for the Appendix
CONSORT2.pdf: CONSORT flow chart of Study 2 for the Appendix
CONSORT3.pdf: CONSORT flow chart of Study 3 for the Appendix
forestplot_combined.pdf: Figure 5 (merge of figures created by
Required R packages
- cowplot (<= 0.9.4)
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: