Nothing
## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.width = 7,
fig.height = 5
)
## ----example------------------------------------------------------------------
library(fdid)
data(fdid) # loads `mortality`
# Unique unit ID and binary treatment factor
mortality$uniqueid <- paste(mortality$provid, mortality$countyid, sep = "-")
mortality$G <- as.integer(mortality$pczupu >= median(mortality$pczupu, na.rm = TRUE))
# Prepare wide-format data
s <- fdid_prepare(
data = mortality,
Y_label = "mortality",
X_labels = c("avggrain", "nograin", "urban", "dis_bj",
"dis_pc", "rice", "minority", "edu", "lnpop"),
G_label = "G",
unit_label = "uniqueid",
time_label = "year"
)
# Estimate
result <- fdid(s, tr_period = 1958:1961, ref_period = 1957)
summary(result)
## ----plots, fig.show="hold"---------------------------------------------------
plot(result, type = "raw")
plot(result, type = "dynamic")
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.