I'm new in Rstudio and am trying to familiarize myself with the package Twang to do propensity weighting. I'm using the code as described in the tutorial from the developers (RAND coorporation)
I believe you are just making a typo, have in mind that code shown in your tutorial is not in a "copy & paste" friendly format, you have to manually remove the "+" symbols of the left margin.
I runed this code and it worked normally:
library(twang)
set.seed(1)
data(lalonde)
ps.lalonde <- ps(treat ~ age + educ + black + hispan + nodegree + married + re74 + re75,
data = lalonde,
n.trees=5000,
interaction.depth=2,
shrinkage=0.01,
perm.test.iters=0,
stop.method=c("es.mean","ks.max"),
estimand = "ATT",
verbose=FALSE)
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: