With no weights the estimator is the textbook difference of group
means; passing forest weights turns it into a local estimate.
Usage
did_estimate(delta, D, weights = NULL)
Arguments
- delta
Numeric vector of Delta_i.
- D
Numeric 0/1 vector.
- weights
Optional non-negative weight vector.
Value
A list with estimate, treated_change,
control_change, treated_weight,
control_weight.
Examples
delta <- c(1.2, 0.9, 1.4, 0.2, 0.1, 0.3)
D <- c(1, 1, 1, 0, 0, 0)
did_estimate(delta, D)$estimate # mean(1.2, 0.9, 1.4) - mean(0.2, 0.1, 0.3)
#> [1] 0.9666667