Week 5
Sep 17, 2025
Published in the American Economic Review (2007):
Adapted from Nick Hagerty’s Course Materials
DG’s baseline climate measure (dd89_7000) has a value of zero degree days for 163 counties. If correct, this measure implies temperatures do not exceed 8°C (46.4°F) in those counties during the growing season of April through September. Temperatures this low would seem implausible in any state, yet many of these counties are in warm southern states such as Texas.
Contrary to the results in DG (2007), the corrected data suggest that an immediate shift to the projected end-of-the-century climate would reduce agricultural profits.

Originally reported “the intervention, compared with usual care, resulted in a fewer number of mean COPD-related hospitalizations and emergency department visits at 6 months per participant.”
There were actually more COPD-related hospitalizations and emergency department visits in the intervention group compared to the control group
Mixed up the intervention vs. control group using “0/1” coding
Avoiding errors is only the first step. It’s also critical to make your work reproducible.
In the private sector, the benefits may be more obvious.
Your code has to work together with other people’s code.
Eventually, someone else will take over your code.
In academic research, it’s equally important.
To trust the results – many research findings fail to replicate.
To build on your work and collaborate with others.
Many journals now require a full “replication package” of data and code.
The push for transparency and reproducibility is known as the open science movement.
Reproducibility: Can someone else run your code and get the exact same results?
Replication: If another analyst attempts the same question, do they get the same answer?
Transparency: Can everyone see what choices you made and how you got your results?
What does it mean for an analysis to be reproducible?
Near term goals:
✔️ Can the tables and figures be exactly reproduced from the code and data?
✔️ Does the code actually do what you think it does?
✔️ In addition to what was done, is it clear why it was done?
Long term goals:
✔️ Can the code be used for other data?
✔️ Can you extend the code to do other things?
Scriptability \(\rightarrow\) R
Literate programming (code, narrative, output in one place) \(\rightarrow\) Quarto
Version control \(\rightarrow\) Git / GitHub
R is a statistical programming language
RStudio is a convenient interface for R (an integrated development environment, IDE)
Source: Statistical Inference via Data Science
Fully reproducible reports – the analysis is run from the beginning each time you render
Code goes in chunks and narrative goes outside of chunks
Visual editor to make document editing experience similar to a word processor (Google docs, Word, Pages, etc.)
Every application exercise and assignment is written in a Quarto document
You’ll have a template Quarto document to start with
The amount of scaffolding in the template will decrease over the semester
with human readable messages

Provides a clear record of how the analysis methods evolved. This makes analysis auditable and thus more trustworthy and reliable. (Ostblom and Timbers 2022)
Image from xkcd (source)
ECON2250 Statistics for Economics - Fall 2025 - Maghfira Ramadhani