Skip to contents

Treated units receive weight 1; controls receive \(w_i = \hat{e}(X_i)/(1-\hat{e}(X_i))\).

Usage

morie_estimate_att(data, treatment, outcome, covariates, propensity_col = NULL)

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.

Value

Named list: att, se, ci_lower, ci_upper, n_treated.

Details

The propensity scores come from morie_estimate_propensity_scores() (native logistic regression); the weighted difference and its influence-function SE are closed form.

Examples

set.seed(2)
df <- data.frame(t = rbinom(200, 1, 0.4), y = rnorm(200), x = rnorm(200))
morie_estimate_att(df, "t", "y", "x")
#> $att
#> [1] 0.018783
#> 
#> $se
#> [1] 0.1568294
#> 
#> $ci_lower
#> [1] -0.2886027
#> 
#> $ci_upper
#> [1] 0.3261687
#> 
#> $n_treated
#> [1] 75
#>