
IRM-DML (or the whole estimator battery) fitted separately by year
Source:R/otis_causal.R
morie_otis_per_year_irm_dml.RdSplits df on year_col and fits
morie_otis_irm_dml in each year. With
full_battery = TRUE each year instead gets IPW, AIPW,
g-computation, PSM 1:1, PSM subclassification, ATC, PLR, SuperLearner
AIPW, IRM-DML and PSM-then-IRM-DML. A year whose fit fails records the
error message rather than stopping the others.
Usage
morie_otis_per_year_irm_dml(
df,
treatment,
outcome,
covariates,
year_col = "EndFiscalYear",
cluster_cols = NULL,
n_folds = 3L,
seed = 123L,
full_battery = FALSE
)Arguments
- df
A data frame.
- treatment
Binary treatment column name.
- outcome
Outcome column name.
- covariates
Character vector of covariate names.
- year_col
Column to split on (default
"EndFiscalYear").- cluster_cols
NULL, a single column name, or a length-2 character vector for two-way clustering.- n_folds
Number of cross-fitting folds (default 3).
- seed
Integer seed (default 123).
- full_battery
Logical; run every estimator per year.