Skip to contents

Runs the DLRM estimator battery separately in each fiscal year through morie_otis_per_year_irm_dml with full_battery = TRUE and tabulates one row per (year, estimator). Stable signs across estimators within a year argue against misspecification; stable magnitudes across years argue for temporal stationarity.

Usage

morie_otis_analyze_ruhela_per_year(
  data,
  ds_id,
  treatment,
  outcome,
  covariates,
  year_col = "EndFiscalYear",
  cluster_col = "EndFiscalYear",
  out_dir = NULL
)

Arguments

data

Data frame holding the treatment, outcome, covariates and year column.

ds_id

Dataset id label.

treatment

Treatment column name.

outcome

Outcome column name.

covariates

Character vector of covariate column names.

year_col

Year column (default "EndFiscalYear").

cluster_col

Cluster axis for the IRM-DML SE, or NULL.

out_dir

Optional output directory.

Value

morie_otis_analysis_result; payload$by_year holds the per-year fits.

Examples

# \donttest{
set.seed(1)
n <- 400L
x <- rnorm(n)
d <- rbinom(n, 1, plogis(0.4 * x))
df <- data.frame(T = d, Y = 0.5 * d + x + rnorm(n), x = x,
                 EndFiscalYear = rep(2023:2024, each = n / 2))
r <- morie_otis_analyze_ruhela_per_year(df, ds_id = "demo", treatment = "T",
                                        outcome = "Y", covariates = "x",
                                        cluster_col = NULL)
head(r$tables[[1L]]$rows, 3L)
#> [[1]]
#> [1] "2023"             "IPW"              "+0.7467"          "0.2108"          
#> [5] "[+0.333, +1.160]" "3.98e-04"         "n=200"           
#> 
#> [[2]]
#> [1] "2023"             "AIPW"             "+0.7488"          "0.1692"          
#> [5] "[+0.417, +1.080]" "9.65e-06"         "n=200"           
#> 
#> [[3]]
#> [1] "2023"             "GCOMP"            "+0.7347"          "0.1534"          
#> [5] "[+0.434, +1.035]" "1.68e-06"         "n=200"           
#> 
# }