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 data frame.

treatment

Name of the binary treatment column.

outcome

Name of the outcome column.

covariates

Character vector of covariate names.

group_col

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

propensity_col

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

outcome_model

Family for the outcome model: "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.00110438 0.1530732 -0.2989192 0.3011279 160
#> 2     A 0.08496760 0.1992637 -0.3055892 0.4755244 140