Skip to content

Instantly share code, notes, and snippets.

View bschneidr's full-sized avatar

Ben Schneider bschneidr

View GitHub Profile
@ajdamico
ajdamico / survey design subsetting.R
Created February 28, 2019 17:11
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)