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))\).
Details
When WeightIt is installed the propensity step delegates to
WeightIt::weightit(); otherwise the inline logistic
regression is used. The Hajek difference and influence-function SE
below are evaluated inline either way so the result list shape and
the closed-form variance preserved.
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")
#> $ate
#> [1] -0.05436274
#>
#> $se
#> [1] 0.1416003
#>
#> $ci_lower
#> [1] -0.3318993
#>
#> $ci_upper
#> [1] 0.2231738
#>
#> $n
#> [1] 200
#>
#> $ess
#> [1] 193.729
#>