This project analyzes the effectiveness of handheld device bans on traffic fatalities across U.S. states from 1983 to 2012. Using advanced econometric methods including Fixed Effects models, Difference-in-Differences (DiD), and the Sun & Abraham estimator, we examine how these policies affect different types of traffic fatalities while controlling for various demographic and infrastructure factors. The .pdf version of the poster can be accessed here
Our analysis leverages a comprehensive dataset of state-level traffic fatalities, combining it with policy implementation dates and various control variables. We employ several methodological approaches:
- Fixed Effects Models: Control for time-invariant state characteristics and temporal trends
- Difference-in-Differences: Exploit policy variation across states and time
- Sun & Abraham Estimator: Account for treatment effect heterogeneity
# Base Fixed Effects Model
m1 = feols(totfat ~ hha | state + year,
cluster = ~ state, data)
# Full Model with Controls
m5 = feols(c(totfat, occfat, noccfat) ~
hha + totpop + avgage + pcinc + lim70 |
state + year,
cluster = ~ state, data)
# Statewide Variables
s2 = feols(c(totfat, occfat, noccfat) ~
hha + totpop + avgage + pcinc + lim70 + fueltax +
milrur * rurdense + milurb * urbdense |
state + year,
cluster = ~ state, data)
# Fixed Effect Regressions
t3 = feols(noccfat ~
hha + totpop + avgage + pcinc + lim70 + fueltax |
state + year,
cluster = ~ state, data)
We examine multiple outcome variables
:
- Total traffic fatalities
- Occupant fatalities
- Non-occupant fatalities
Control variables
include:
- Population demographics
- Economic indicators
- Road infrastructure characteristics
- Speed limit policies
- Fuel taxes
# Sun and Abraham Estimator
d4 = feols(totfat ~ sunab(mintreatyear, year) + totpop + avgage + pcinc + lim70 + fueltax | state + year, data = data, cluster = ~ state)
d5 = feols(totfat ~ sunab(mintreatyear, year) + totpop + avgage + pcinc + lim70 + fueltax + milrur * milurb + rurdense * urbdense | state + year, data = data, cluster = ~ state
)
iplot(
list(d5, d4),
xlab = "Relative Handheld Device Ban Year",
main = "Effect on Total Traffic Fatalities"
)
ggplot(data_c, aes(x = tau, y = mean_fat)) +
geom_point() +
geom_smooth(method = "loess") +
xlab("Years Relative to Treatment") +
ylab("Mean Traffic Fatalities") +
ggtitle("Mean Traffic Fatalities Over Time Since Treatment")
- R version 4.0+
- Required packages:
library(tidyverse) library(fixest) library(plm) library(estimatr) library(stargazer)
- Clone the repository
- Install required packages:
install.packages(c("tidyverse", "fixest", "plm", "estimatr", "stargazer"))
- Run the analysis:
source("traffic_fat_script.R")