Skip to content

Does "coeftest" correctly use weights from "svydesign" in "svyglm" object?

2 messages · André Grow, Anthony Damico

#
Dear all,

 

I am using data from the European Social Survey (ESS) and I would like to
calculate country-level cluster-robust standard errors for a regression
model in R that includes country fixed effects and employs the design
weights that come with the ESS.

 

To correctly use the weights, I use the 'survey' package and the functions
'svydesign' and 'svyglm'. This step looks like this:

 

design_1 <- svydesign(id=~1, weights=~dweight, data=ESS)

 

m1 <- svyglm(y ~ cntry + x, design = design_1)

 

My question is: when I now apply the functions 'cluster.vcov' and 'coeftest'
from the packages 'lmtest' and 'multiwayvcov' to the model m1, do the
resulting standard errors correctly account for the design weights? This
step looks like this:

 

vcov_m1 <- cluster.vcov(m1, ESS$cntry)

 

coeftest(m1, vcov_m1)

 

Note that I do not use 'cntry' as an id variable in the svydesign function,
because then I cannot include country dummies in the regression model.

 

Thanks in advance for your feedback!
#
hi, that setup is not correct.  see examples in

https://github.com/ajdamico/asdfree/tree/master/European%20Social%20Survey
On Feb 8, 2017 11:54 PM, "Andr? Grow" <grow.andre at gmail.com> wrote: