data(api)
dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat,
fpc=~fpc)
svyqqmath(~api99, design=dstrat)
svyqqplot(api00~api99, design=dstrat)
dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
opar<-par(mfrow=c(1,2))
## sample distributions very different
qqplot(apiclus1$enroll, apistrat$enroll); abline(0,1)
## estimated population distributions much more similar
svyqqplot(enroll~enroll, design=dstrat,designx=dclus1,qrule=survey:::qrule_hf8); abline(0,1)
par(opar)
Run the code above in your browser using DataLab