Well it's splines::bs
require(WeightIt)
#> Loading required package: WeightIt
weightit(weight ~ splines::bs(women$height), data = women, estimand="ATE", method="ps", stabilize=T, include.obj = T)
#> Error in terms.formula(new.form): invalid model formula in ExtractVars
Created on 2020-01-02 by the reprex package (v0.3.0)
weightit expects the same formula arguments in the model as glm. The splines::bs(women$height) object looks like
require(WeightIt)
#> Loading required package: WeightIt
str((splines::bs(women$height)))
#> 'bs' num [1:15, 1:3] 0 0.185 0.315 0.397 0.437 ...
#> - attr(*, "dimnames")=List of 2
#> ..$ : NULL
#> ..$ : chr [1:3] "1" "2" "3"
#> - attr(*, "degree")= int 3
#> - attr(*, "knots")= num(0)
#> - attr(*, "Boundary.knots")= num [1:2] 58 72
#> - attr(*, "intercept")= logi FALSE
Created on 2020-01-02 by the reprex package (v0.3.0)
not a vector object.