| fect_sens | R Documentation |
Conducts sensitivity analyses on fect model objects under relative magnitude (RM) and smoothness (C-LF) assumptions, producing robust confidence intervals and parameter sets.
fect_sens(
fect.out,
post.periods = NA,
l_vec = NA,
Mbarvec = seq(0, 1, by = 0.1),
Mvec = seq(0, 0.25, 0.05),
periodMbarvec = c(0, 0.5),
periodMvec = c(0, 0.1),
parallel = FALSE,
cores = NULL
)
fect.out |
A fitted |
post.periods |
Vector of post-treatment periods for sensitivity analysis. Default uses all available post-treatment periods. |
l_vec |
Optional weighting vector for averaging ATT across post-treatment periods. Default weights by treated-unit counts. |
Mbarvec |
Values of |
Mvec |
Values of |
periodMbarvec |
Values of |
periodMvec |
Values of |
parallel |
Logical; if |
cores |
Optional integer; number of workers when |
This function:
Extracts ATT estimates and variance-covariance matrices from fect.out.
Constructs weighted averages across post-treatment periods.
Computes robust confidence sets under RM and C-LF assumptions.
Optionally computes robust bounds for each post-treatment period separately.
Robust sets are computed using functions from the HonestDiDFEct package.
An updated fect object including:
sensitivity.rm |
Relative Magnitude (RM) sensitivity results for average and period-by-period ATT. |
sensitivity.smooth |
Smoothness (C-LF) sensitivity results for average and period-by-period ATT. |
Rivka Lipkovitz
## Not run:
out <- fect(Y ~ D, data = df, index = c("unit", "time"), method = "fe", se = TRUE)
out_sens <- fect_sens(
fect.out = out,
post.periods = c(1, 2, 3, 4),
Mbarvec = seq(0, 1, by = 0.2),
Mvec = c(0, 0.05, 0.1),
periodMbarvec = c(0, 0.5),
periodMvec = c(0, 0.1)
)
names(out_sens$sensitivity.rm)
names(out_sens$sensitivity.smooth)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.