data(scd)
scddes<-svydesign(data=scd, prob=~1, id=~ambulance, strata=~ESA,
nest=TRUE, fpc=rep(5,6))
scdnofpc<-svydesign(data=scd, prob=~1, id=~ambulance, strata=~ESA,
nest=TRUE)
# convert to BRR replicate weights
scd2brr <- as.svrepdesign(scdnofpc, type="BRR")
# convert to JKn weights
scd2jkn <- as.svrepdesign(scdnofpc, type="JKn")
# convert to JKn weights with finite population correction
scd2jknf <- as.svrepdesign(scddes, type="JKn")
svrepratio(~alive, ~arrests, design=scd2brr)
svrepratio(~alive, ~arrests, design=scd2jkn)
svrepratio(~alive, ~arrests, design=scd2jknf)
data(api)
dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
rclus1<-as.svrepdesign(dclus1)
svrepmean(~api00, rclus1)
svreptotal(~enroll, rclus1)
Run the code above in your browser using DataLab