Replication material for "Limitless Regression Discontinuity"
To reproduce the results in the paper:
- Make sure R is up-to-date with required packages installed:
- We used R version 3.4.4
- Required packages to carry out analyses:
robustbaserddsadnwichnnetRItools
- Required packages to display results (paper, analysis documents):
knitrkableExtraggplotgridExtra
- Optional packages:
parallelto run simulations in parallelrmarkdownto make analysis documents more easily
- In
R, Run data analysis:
library(knitr)
knit('dataAnalysis.Rmd')
- Creates files:
dataAnalysis.mdanalysis documentRDanalysis-[M][D][Time].RDataanalysis outputtab-results.textab-alt.textables 1 & 2 for paper
- In
RRun simulation studies
nrep <- 5000 ## number of simulation replications
knit('fullOutcomeSim.Rmd')
- Substitute
nrep <- XforXsimulation replications nrep <- 0loads previously-run simulation- Creates files:
fullOutcomeSim.mdanalysis documentoutcomeSim-YYYY-MM-DD.RDatasimulation results for table 3totalPolySim-YYYY-MM-DD.RDatasimulation results for table 4tab-levelSimulation.texlatex for table 3tab-polynomialSimulation.texlatex for table 4- some other random files.
- In
Rcompile LaTeX for the manuscript:
knit('lrd-r1.Rnw')
- In the console, compile the pdf:
pdflatex lrd-r1.tex
bibtex lrd-r1
pdflatex lrd-r1.tex
pdflatex lrd-r1.tex