Exercises in R
This section has link to the files for the demos and replication exercises that we will do in class. Here, you will find link to files with annotated code and csv files with data for the replication exercises.
Monday 2/20
Matching demo in R. I couldn’t figure out a cute way for you to be able to download this directly as a RMarkdown file (thwarted by quarto…). But this link will take you to the page in the course’s GitHub repository where the RMarkdown file is stored. Click on “Raw,” then you can copy and paste the code into an RMarkdown on your computer.
Wednesday 2/22
In this replication exercise, you will use a subset of the data from Siegel et al. 2022 to play around with matching using a real dataset. The data are available for download on the course Canvas page, under the header “IV Quasi Experimental Designs: Matching.” There are two csv files of data: colo_dat_full.csv and colo_data_for_matching.csv. colo_dat_full.csv has the entire time series of data for the full (unmatched) dataset of federal and private forests in Colorado. colo_data_for_matching.csv is a file that’s ready for the matching process without additional pre-processing: it has a row for each sample point in Colorado and five-year averages for the climate variables.
Monday 2/27
Diff-in-Diff regression demo in R Application and interpretation of differences-in-differences to examine effects of the Marshall Fire on vegetation in Boulder, CO. Data file is on Canvas course page.
Optional: Review of difference-in-difference covered in lecture in RMarkdown, see here
Monday 3/6
Panel regression demo in R This tutorial replicates the main analyses in Dee et al, contrasted with common approaches in ecology (mixed effect models and conditioning on observable covariates. For the rest of the supplemental analyses in Dee et al, see L.Dee’s GitHub
Wednesday 3/15
Instrumental variables demo in R. Link to an RMarkdown file that walks through the process of coding an analysis using an instrumental variable.
Wednesday 3/22
Regression discontinuity design demo in R. Link to an RMarkdown file that walks through the process of coding an analysis using regression discontinuity analysis.