Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
incorrect standard errors when not including the full design information
library(survey)
data(api)
x <- apistrat
x <- subset( x , comp.imp == 'Yes' )
dstrat_before<-svydesign(id=~1,strata=~stype, weights=~pw, data=x, fpc=~fpc)
dstrat_after<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
dstrat_after <- subset( dstrat_after , comp.imp == 'Yes' )
SE( svymean( ~ api00 , dstrat_after ) )
SE( svymean( ~ api00 , dstrat_before ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.