I would like to know how the treatment of weights differs between svyglm
and glm
I am using the twang
package in R to create propensity scores which are then used as weights, as follows (this code comes from the twang
documentation):
library(twang)
library(survey)
set.seed(1)
data(lalonde)
ps.lalonde <- ps(treat ~ age + educ + black + hispan + nodegree + married + re74 + re75,
data = lalonde)
lalonde$w <- get.weights(ps.lalonde, stop.method="es.mean")
design.ps <- svydesign(ids=~1, weights=~w, data=lalonde)
glm1 <- svyglm(re78 ~ treat, design=design.ps)
summary(glm1)
...
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6685.2 374.4 17.853 <2e-16 ***
treat -432.4 753.0 -0.574 0.566
Compare this to:
glm11 <- glm(re78 ~ treat, weights=w , data=lalonde)
summary(glm11)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6685.2 362.5 18.441 <2e-16 ***
treat -432.4 586.1 -0.738 0.461
So the parameter estimates are the same but the standard errors for the treatment are quite different.
How does the treatment of weights differ between svyglm
and glm
?