svyrecvar(x, clusters, stratas,fpcs, postStrata = NULL,
lonely.psu = getOption("survey.lonely.psu"),
one.stage=getOption("survey.ultimate.cluster"))
as.fpc
postStratify
or calibrate
TRUE
, compute a one-stage
(ultimate-cluster) estimatorone.stage=FALSE
for compatibility with other software that
does not perform multi-stage calculations, and set
options(survey.ultimate.cluster=TRUE)
to make this the default.
The idea of a recursive algorithm is due to Bellhouse (1985).
Texts such as Cochran (1977) and Sarndal et al (1991) describe the
decomposition of the variance into a single-stage between-cluster
estimator and a within-cluster estimator, and this is applied recursively.
If one.stage
is a positive integer it specifies the number of
stages of sampling to use in the recursive estimator.Cochran, W. (1977) Sampling Techniques. 3rd edition. Wiley. Sarndal C-E, Swensson B, Wretman J (1991) Model Assisted Survey Sampling. Springer.
svrVar
for replicate weight designs
svyCprod
for a description of how variances are
estimated at each stagedata(mu284)
dmu284<-svydesign(id=~id1+id2,fpc=~n1+n2, data=mu284)
svytotal(~y1, dmu284)
data(api)
# two-stage cluster sample
dclus2<-svydesign(id=~dnum+snum, fpc=~fpc1+fpc2, data=apiclus2)
summary(dclus2)
svymean(~api00, dclus2)
svytotal(~enroll, dclus2,na.rm=TRUE)
# two-stage `with replacement'
dclus2wr<-svydesign(id=~dnum+snum, weights=~pw, data=apiclus2)
summary(dclus2wr)
svymean(~api00, dclus2wr)
svytotal(~enroll, dclus2wr,na.rm=TRUE)
Run the code above in your browser using DataLab