ATT Estimation Wrapper: Nuisance Estimation Plus doubly robust DiD
Source:R/att-estimate.R
att_estimate.RdUnified workflow for two-period, two-group ATT estimation. The function
estimates generalized propensity scores and outcome regressions with
local-polynomial smoothing, cross-fitted DML-style learners, or parametric
first steps, then plugs the nuisance predictions into
drdid_nonstationary().
Usage
att_estimate(
dp,
nuisance_method = c("loo", "dml", "parametric"),
ps_cv_method = "cv.ml",
lp_type = "logit",
list_control_ps = list(n_start = 1, ps_min = 1e-05, cv_type = "loocv", lp_order = 1,
bw_seed = NULL, bw_upper_cont = "adaptive", n_threads = 0, rcv_train_frac = 0.5),
list_control_or = list(n_start = 2, bw_constrained = FALSE, cv_type = "loocv", or_order
= 1, bw_seed = NULL, bw_upper_cont = "adaptive", rcv_train_frac = 0.5),
dml_backend = c("custom", "mlr3"),
parametric_method = c("improved", "base"),
K = 2,
seed = 123,
fold_id = NULL,
ps_learner = NULL,
or_learner = NULL,
ps_learner_param = list(),
or_learner_param = list(),
tune_ps = FALSE,
tune_or = FALSE,
ps_search_space = NULL,
or_search_space = NULL,
ps_tuner = "random_search",
or_tuner = "random_search",
ps_term_evals = 20L,
or_term_evals = 20L,
ps_inner_folds = 3L,
or_inner_folds = 3L,
ps_measure = NULL,
or_measure = NULL,
stabilized = TRUE,
i.weights = NULL,
boot = FALSE,
nboot = NULL,
boot_type = c("mammen", "normal", "bayes", "wild"),
inffunc = TRUE,
...
)Arguments
- dp
Data list containing
y,d,post,dpost,covariates, anddim_covariates. For user-supplied data, construct this object withmake_did_dp().- nuisance_method
Either
"loo"for local-polynomial nuisance estimation,"dml"for cross-fitted nuisance estimation, or"parametric"for fixed-dimensional parametric first steps.- ps_cv_method
Bandwidth CV loss for the GPS model.
- lp_type
Local-polynomial type for the GPS model.
- list_control_ps
Control list for
locpol_ps_fit().- list_control_or
Control list for
locpol_or_fit().- dml_backend
DML nuisance backend:
"custom"or"mlr3". The default custom backend uses the built-incompdid_cell_ps()andcompdid_cell_or()learners.- parametric_method
Parametric nuisance method.
"improved"fits the pairwise-IPT odds-ratio and weighted least-squares first steps;"base"fits multinomial-logit generalized propensity scores and OLS outcome regressions.- K
Number of folds for cross-fitting.
- seed
Random seed for fold assignment when
fold_idisNULL.- fold_id
Optional integer vector of length
nwith values in1:K.- ps_learner
For
dml_backend = "mlr3", a learner id or learner object for multiclass classification. Fordml_backend = "custom", a function(dp_train, dp_test, ...) -> n_test x 4. IfNULL, defaults tocompdid_cell_ps()for the custom backend and"classif.multinom"for the mlr3 backend.- or_learner
For
dml_backend = "mlr3", a learner id or learner object for regression. Fordml_backend = "custom", a function(dp_train, dp_test, ...) -> n_test x 4. IfNULL, defaults tocompdid_cell_or()for the custom backend and"regr.lm"for the mlr3 backend.- ps_learner_param, or_learner_param
Optional named lists of mlr3 parameter values.
- tune_ps, tune_or
Logical; if
TRUE, tune the corresponding learner inside each training fold.- ps_search_space, or_search_space
paradox::ParamSetsearch spaces used when tuning is enabled.- ps_tuner, or_tuner
Tuner object or tuner id string.
- ps_term_evals, or_term_evals
Integer tuning budgets.
- ps_inner_folds, or_inner_folds
Integer inner-CV folds used for tuning.
- ps_measure, or_measure
Optional mlr3 measure object or id.
- stabilized
Logical; passed to
drdid_nonstationary().- i.weights
Optional weights. Non-unit sampling weights are not yet supported by the current doubly robust second stage.
- boot
Logical; if
TRUE, use bootstrap-based inference.- nboot
Number of bootstrap replications if
boot = TRUE.- boot_type
Multiplier-bootstrap type.
- inffunc
Logical; return influence function from the doubly robust stage.
- ...
Extra arguments forwarded to nuisance fitting calls.