data(fpc)
dfpc<-svydesign(id=~psuid,strat=~stratid,weight=~weight,data=fpc,nest=TRUE)
dsub<-subset(dfpc,x>4)
summary(dsub)
## These should give the same estimates and variances
svymean(~x,dsub)
svyglm(x~I(x>4)+0,design=dfpc)
Run the code above in your browser using DataLab