Instructions
Deadline Friday 05/12/25
Create a new repo called CSDiD and work with your group members like in previous assignments. The repo should have the following structure
CSDiD/
├── Python/
│ ├── output/
│ └── scripts/
├── R/
│ ├── output/
│ └── scripts/
- For visualization purposes, please provide your solutions in Jupyter Notebooks, including code, graphs, and explanations, using Python and R. Don't forget to export graphs to the /output folder.
- You may choose to place everything in a single notebook or split the work across multiple notebooks, as long as the submissions are in Jupyter Notebook format
- If you have trouble with Jupyter Notebooks you can use VScode or some other IDE, just present things in an orderly manner and clearly respond to questions as comments when required. Also export tables to the /output folder if you won't present your results in Jupyter Notebooks.
- You can load the data by calling the link. However, if you load locally without the link please include an input folder with the data in it.
Question 1 — TWFE & Event-Study (Total: 8 points)
a) TWFE
Load the dataset available:
https://raw.githubusercontent.com/LOST-STATS/LOST-STATS.github.io/master/Model_Estimation/Data/Event_Study_DiD/bacon_example.csv
Note that asmrs is the outcome variable, pcinc, asmrh and cases are controls. The dataset already includes treatment and post-treatment variables.
Estimate a Two-Way Fixed Effects (TWFE) regression with unit and time fixed effects.
Points:
b) Cleaning for Event-Study
- Create the relative time variable (event time = time − treatment time).
- Provide a frequency table or descriptive summary of event time.
- Based on the distribution, choose reasonable upper and lower bounds for grouping extreme event times.
- Question: Why do we usually group very distant event times together?
- Create relative-time dummy variables.
Points:
- Relative time creation: 1.5
- Frequency table: 0.5
- Choosing bounds: 0.5
- Question: 0.5
- Dummy creation: 1
c) Event-Study Estimation
- Estimate an Event-Study model using the relative-time dummies.
- Store coefficient estimates and standard errors.
- Plot the event-study coefficients with confidence intervals.
Points:
- Estimation: 1
- Storing results: 0.5
- Plot: 0.5
Question 2 — CSDiD (Total: 12 points)
a) Estimation
Using CSDiD, estimate ATT(g,t). Present results in a clean table.
(You may choose which controls to include.)
Points:
- CSDiD estimation: 2
- ATT(g,t) table: 1
b) Aggregations
Compute and present:
- Aggregation by group
- Aggregation by period
- Aggregation by event-time
Points:
c) Explanation of Aggregations
Explain:
- Meaning of aggregation by group
- Meaning of aggregation by period
- Meaning of aggregation by event-time
- Question: Which aggregation is most comparable to the TWFE Event-Study coefficients?
Points:
- Explanations: 1.5
- Comparison question: 1
d) Compare CSDiD and Event-Study Results
- Create a table comparing:
- Event-time aggregated ATT from CSDiD
- Event-study coefficients from the TWFE model
- Produce a combined coefficient plot.
- Provide a brief comparison.
Points:
- Comparison table: 1
- Combined plot: 1
- Discussion: 1.5
Instructions
Deadline Friday 05/12/25
Create a new repo called CSDiD and work with your group members like in previous assignments. The repo should have the following structure
Question 1 — TWFE & Event-Study (Total: 8 points)
a) TWFE
Load the dataset available:
https://raw.githubusercontent.com/LOST-STATS/LOST-STATS.github.io/master/Model_Estimation/Data/Event_Study_DiD/bacon_example.csv
Note that
asmrsis the outcome variable,pcinc,asmrhandcasesare controls. The dataset already includes treatment and post-treatment variables.Estimate a Two-Way Fixed Effects (TWFE) regression with unit and time fixed effects.
Points:
b) Cleaning for Event-Study
Points:
c) Event-Study Estimation
Points:
Question 2 — CSDiD (Total: 12 points)
a) Estimation
Using CSDiD, estimate ATT(g,t). Present results in a clean table.
(You may choose which controls to include.)
Points:
b) Aggregations
Compute and present:
Points:
c) Explanation of Aggregations
Explain:
Points:
d) Compare CSDiD and Event-Study Results
Points: