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

André Grow grow.andre at gmail.com
Wed Feb 8 20:43:29 CET 2017


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!


	[[alternative HTML version deleted]]



More information about the R-help mailing list