Skip to contents

Estimates the Average Treatment Effect via a (weighted) mean difference between treated and control outcomes. Uses the explicit _matched suffix to distinguish it from the IPW estimator morie_estimate_ate in causal.R.

Usage

morie_matching_ate_matched(
  data,
  outcome,
  treatment,
  covariates,
  weights = NULL,
  alpha = 0.05
)

Arguments

data

Data frame.

outcome, treatment

Column names.

covariates

Character vector of covariates (carried for parity with the Python signature).

weights

Optional column of matching / weighting weights.

alpha

Significance level for confidence intervals.

Value

A list of class morie_te_result.

Examples

# \donttest{
set.seed(1)
df <- data.frame(y = rnorm(200), d = rbinom(200, 1, 0.4),
                 x1 = rnorm(200), x2 = rnorm(200))
m <- morie_matching_cem(df, "d", c("x1", "x2"), n_bins = 5)
morie_matching_ate_matched(m$matched_data, "y", "d", c("x1", "x2"),
                           weights = "weights")
#> $estimand
#> [1] "ATE"
#> 
#> $estimate
#> [1] -0.01320857
#> 
#> $std_error
#> [1] 0.1500088
#> 
#> $ci_lower
#> [1] -0.3072203
#> 
#> $ci_upper
#> [1] 0.2808032
#> 
#> $p_value
#> [1] 0.9298354
#> 
#> $n_obs
#> [1] 193
#> 
#> $details
#> list()
#> 
#> attr(,"class")
#> [1] "morie_te_result" "list"           
# }