The Hajek estimator uses stabilised IPW weights: $$\widehat{ATE} = \bar{y}_1^{w} - \bar{y}_0^{w}$$ where \(\bar{y}_t^{w} = \sum_{T_i=t} w_i Y_i / \sum_{T_i=t} w_i\) and \(w_i = T_i/\hat{e}(X_i) + (1-T_i)/(1-\hat{e}(X_i))\).
Usage
morie_estimate_ate(
data,
treatment,
outcome,
covariates,
propensity_col = NULL,
trim = c(0.01, 0.99),
trim_type = "value",
ps_model = "mle",
ridge_lambda = 1,
weight_trim = NULL,
weight_trim_side = "upper"
)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.
- trim
See Usage.
- trim_type
See Usage.
- ps_model
See Usage.
- ridge_lambda
See Usage.
- weight_trim
See Usage.
- weight_trim_side
See Usage.
Details
The propensity scores come from the native logistic regression of
morie_estimate_propensity_scores(); the Hajek difference and its
influence-function SE are computed in closed form.
Examples
set.seed(1)
df <- data.frame(
t = rbinom(200, 1, 0.4),
y = rnorm(200),
x = rnorm(200)
)
morie_estimate_ate(df, "t", "y", "x")
#> $n_used
#> [1] 200
#>
#> $n_discarded
#> [1] 0
#>
#> $estimand
#> [1] "ATE on the full sample"
#>
#> $ate
#> [1] -0.05566566
#>
#> $se
#> [1] 0.142874
#>
#> $ci_lower
#> [1] -0.3356987
#>
#> $ci_upper
#> [1] 0.2243673
#>
#> $n
#> [1] 200
#>
#> $ess
#> [1] 193.7158
#>
