Skip to contents

Returns one row per (pair, estimator) combination with the ATE, SE, 95% CI, and per-row notes. The IRM-DML row uses the ATE component of morie_otis_irm_dml()'s output (not the ATTE / ATC). Concordance across all three estimators is the strongest evidence of an identified causal effect under conditional exchangeability.

Usage

morie_otis_causal_grid(df = NULL, seed = 123L)

Arguments

df

OTIS placement-level data.frame. If NULL, attempts to resolve via morie_otis_load().

seed

Integer seed for the cross-fitting (default 123).

Value

Data.frame with columns pair, estimator, n, p_treat, ate, ate_se, ate_pval, ci95_lo, ci95_hi, notes.

Examples

# \donttest{
# Simulated placement-level rows using the b01 dictionary schema
# (regions, age categories, alerts); large enough for cross-fitting.
set.seed(1)
regions <- c("Central", "Eastern", "Northern", "Toronto", "Western")
df <- data.frame(
  UniqueIndividual_ID = 1:300,
  EndFiscalYear = sample(2018:2021, 300, TRUE),
  Gender = sample(c("Male", "Female"), 300, TRUE),
  Age_Category = sample(c("18 to 24", "25 to 49", "50+"), 300, TRUE),
  Region_AtTimeOfPlacement = sample(regions, 300, TRUE),
  Region_MostRecentPlacement = sample(regions, 300, TRUE),
  MentalHealth_Alert = sample(0:1, 300, TRUE),
  SuicideRisk_Alert = sample(0:1, 300, TRUE),
  SuicideWatch_Alert = sample(0:1, 300, TRUE),
  Number_Of_Placements = sample(1:4, 300, TRUE),
  NumberConsecutiveDays_Segregation = rpois(300, 5)
)
morie_otis_causal_grid(df)
#>                                        pair estimator   n p_treat     ate
#> 1           (a) MentalHealth -> SuicideRisk       IPW 300  0.5267 -0.0020
#> 2           (a) MentalHealth -> SuicideRisk      AIPW 300  0.5267  0.0164
#> 3           (a) MentalHealth -> SuicideRisk   IRM-DML 300  0.5267 -0.0002
#> 4 (b) HighAlertComplexity -> AnyReadmission       IPW 300  0.5200 -0.0337
#> 5 (b) HighAlertComplexity -> AnyReadmission      AIPW 300  0.5200 -0.0702
#> 6 (b) HighAlertComplexity -> AnyReadmission   IRM-DML 300  0.5200 -0.1572
#> 7 (c) RegionalVolatility -> SegregationDays       IPW 300  0.7900 -0.3120
#> 8 (c) RegionalVolatility -> SegregationDays      AIPW 300  0.7900 -0.2981
#> 9 (c) RegionalVolatility -> SegregationDays   IRM-DML 300  0.7900 -0.4629
#>   ate_se ate_pval ci95_lo ci95_hi                          notes
#> 1 0.0595   0.9737 -0.1185  0.1146  calibration=none; Brier=0.237
#> 2 0.0676   0.8083 -0.1160  0.1488 cross-fit folds=5; Brier=0.258
#> 3 0.0666   0.9980 -0.1307  0.1304                            iid
#> 4 0.0519   0.5156 -0.1353  0.0679  calibration=none; Brier=0.240
#> 5 0.0614   0.2531 -0.1907  0.0502 cross-fit folds=5; Brier=0.268
#> 6 0.0678   0.0203 -0.2900 -0.0244                            iid
#> 7 0.3871   0.4202 -1.0707  0.4467  calibration=none; Brier=0.165
#> 8 0.4296   0.4877 -1.1401  0.5438 cross-fit folds=5; Brier=0.171
#> 9 0.5133   0.3672 -1.4689  0.5432                            iid
# }