ngreifer / WeightIt

WeightIt: an R package for propensity score weighting
https://ngreifer.github.io/WeightIt/
102 stars 12 forks source link

Error when method = "gbm" and stabilize = TRUE #7

Closed ulriksartipy closed 5 years ago

ulriksartipy commented 5 years ago

From the Examples in the documentation: method_gbm {WeightIt}

The following code works as expected

(W1 <- weightit(treat ~ age + educ + married +
                  nodegree + re74, data = lalonde,
                method = "gbm", estimand = "ATT",
                stop.method = "es.max"))

The addition of the argument "stabilize" produces an error

(W1 <- weightit(treat ~ age + educ + married +
                  nodegree + re74, data = lalonde,
                method = "gbm", estimand = "ATT",
                stop.method = "es.max", stabilize = TRUE))

Error in tab[t] : invalid subscript type 'closure'

ngreifer commented 5 years ago

Thank you! Fixed.

Just so you know, for binary treatments, if you're using weighted regression to estimate treatment effects, it doesn't matter whether you use stabilized weights or not.