| fdid | R Documentation |
Performs factorial difference-in-differences (FDID) estimation using various methods and variance estimation techniques.
fdid(
s,
tr_period,
ref_period,
entire_period = NULL,
method = "ols1",
vartype = "robust",
missing_data = c("listwise", "available"),
nsims = 1000,
parallel = FALSE,
cores = 2,
target.pop = c("all", "1", "0")
)
s |
A data frame prepared using |
tr_period |
A numeric vector specifying the treatment periods. |
ref_period |
A numeric scalar specifying the reference period. |
entire_period |
A numeric vector specifying the total range of time periods.
If |
method |
A string specifying the estimation method.
Options: |
vartype |
A string specifying the variance estimation type.
Options: |
missing_data |
How to handle missing data. Two options:
Default is |
nsims |
Number of simulations for bootstrap variance estimation.
Default is |
parallel |
Logical; whether to perform parallel computations.
Default is |
cores |
Number of cores for parallel computations.
Default is |
target.pop |
Character; the target population for averaging: |
A list with the following components:
est |
A list with three elements:
|
dynamic |
Dynamic FDID estimates for each time in |
raw_means |
Raw mean outcomes by group for each time in |
tr_period |
Treatment periods used. |
ref_period |
Reference period used. |
entire_period |
All time periods for dynamic estimation. |
method |
Method used. |
vartype |
Variance type used. |
times |
All numeric time columns found. |
G |
Group indicator (0/1). |
ps |
Propensity scores (if |
call |
The matched call. |
target.pop |
Character indicating the target population used. |
Rivka Lipkovitz, Enhan Liu
data(fdid)
mortality$uniqueid <- paste(mortality$provid, mortality$countyid, sep = "-")
mortality$G <- ifelse(mortality$pczupu >= median(mortality$pczupu, na.rm = TRUE), 1, 0)
s <- fdid_prepare(
data = mortality, Y_label = "mortality",
X_labels = c("avggrain", "lnpop"),
G_label = "G", unit_label = "uniqueid", time_label = "year"
)
result <- fdid(s, tr_period = 1958:1961, ref_period = 1957)
summary(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.