survey (version 1.9-2)

as.svrepdesign: Convert a survey design to use replicate weights

Description

Creates a replicate-weights survey design object from a traditional strata/cluster survey design object.

Usage

as.svrepdesign(design, type=c("auto", "JK1", "JKn", "BRR", "Fay"),
fay.rho = 0, ...)

Arguments

design
Object of class survey.design
type
Type of replicate weights. "auto" uses JKn for stratified, JK1 for unstratified designs
fay.rho
Tuning parameter for Fay's variance method
...
Other arguments to brrweights, controlling the handling of strata that do not have exactly 2 clusters.

Value

  • Object of class svrep.design.

See Also

brrweights, svydesign, svrepdesign

Examples

Run this code
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)

Run the code above in your browser using DataLab