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("auto", "linear", "logistic"),
  trim = c(0.01, 0.99),
  trim_type = "value",
  ps_model = "mle",
  ridge_lambda = 1,
  outcome_fit = "separate"
)

Arguments

data

A vector; indexed elementwise.

treatment

Passed to morie_estimate_propensity_scores.

outcome

See Usage.

covariates

Passed to morie_estimate_propensity_scores.

propensity_col

Optional; may be NULL. Passed to is.null.

outcome_model

Family for the outcome model: "auto" (logistic for a 0/1 outcome, linear otherwise), "linear" or "logistic".

trim

Passed to .mor_trim_ps. Defaults to c(0.01, 0.99).

trim_type

Passed to .mor_trim_ps. Defaults to "value".

ps_model

Passed to morie_estimate_propensity_scores. Defaults to "mle".

ridge_lambda

Passed to morie_estimate_propensity_scores. Defaults to 1.

outcome_fit

One of "pooled", "separate". Defaults to "separate".

Value

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

Details

The propensity scores come from morie_estimate_propensity_scores() (native logistic regression); the outcome regression and the doubly-robust influence-function score are closed form. 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(60, 1, 0.4), x = rnorm(60))
df$y <- 2 * df$t + df$x + rnorm(60)
morie_estimate_aipw(df, "t", "y", "x")   # outcome_model = "auto" picks linear here
#> $n_used
#> [1] 60
#> 
#> $n_discarded
#> [1] 0
#> 
#> $estimand
#> [1] "ATE on the full sample"
#> 
#> $ate
#> [1] 2.10387
#> 
#> $se
#> [1] 0.243399
#> 
#> $ci_lower
#> [1] 1.626808
#> 
#> $ci_upper
#> [1] 2.580932
#> 
#> $n
#> [1] 60
#>