Skip to contents

Applies AIPW within each level of group_col to estimate stratum-specific treatment effects.

Usage

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

Arguments

data

A vector; indexed elementwise.

treatment

Passed to morie_estimate_propensity_scores.

outcome

See Usage.

covariates

Passed to morie_estimate_propensity_scores.

group_col

Name of the grouping variable (e.g. "gender").

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".

Value

Data frame with columns: group, ate, se, ci_lower, ci_upper, n.

Examples

set.seed(3)
df <- data.frame(
  t = rbinom(300, 1, 0.4),
  y = rnorm(300),
  x = rnorm(300),
  g = sample(c("A", "B"), 300, replace = TRUE)
)
morie_estimate_gate(df, "t", "y", "x", "g")
#>   group         ate        se   ci_lower  ci_upper   n
#> 1     B 0.001229585 0.1529908 -0.2986323 0.3010915 160
#> 2     A 0.084680684 0.1992541 -0.3058574 0.4752188 140