Skip to contents

Combines IPW and outcome regression corrections. Consistent if either the propensity model or the outcome model is correctly specified.

Usage

morie_estimate_aipw(
  data,
  treatment,
  outcome,
  covariates,
  propensity_col = NULL,
  outcome_model = c("linear", "logistic")
)

Arguments

data

A data frame.

treatment

Name of the binary treatment column.

outcome

Name of the outcome column.

covariates

Character vector of covariate names.

propensity_col

Optional: name of a pre-computed propensity score column.

outcome_model

Family for the outcome model: "linear" or "logistic".

Value

Named list: ate, se, ci_lower, ci_upper, n.

Details

The propensity step delegates to WeightIt when installed (via morie_estimate_propensity_scores). The outcome regression and the doubly-robust influence-function score are evaluated inline to preserve the closed-form SE used downstream. Where richer outputs are desired, AIPW::AIPW (with SuperLearner nuisance learners) is the canonical CRAN counterpart.

Examples

set.seed(1)
df <- data.frame(t = rbinom(200, 1, 0.4), y = rnorm(200), x = rnorm(200))
morie_estimate_aipw(df, "t", "y", "x")
#> $ate
#> [1] -0.05433513
#> 
#> $se
#> [1] 0.1415487
#> 
#> $ci_lower
#> [1] -0.3317705
#> 
#> $ci_upper
#> [1] 0.2231003
#> 
#> $n
#> [1] 200
#>