svyratio {survey}R Documentation

Ratio estimation

Description

Ratio estimation and estimates of totals based on ratios for complex survey samples.

Usage

## S3 method for class 'survey.design2':
svyratio(numerator, denominator, design,...)
## S3 method for class 'svyrep.design':
svyratio(numerator, denominator, design,...)
## S3 method for class 'svyratio':
predict(object, total, se=TRUE,...)

Arguments

numerator formula, expression, or data frame giving numerator variable(s)
denominator formula, expression, or data frame giving denominator variable(s)
design from svydesign for svyratio, from svrepdesign for svrepratio
object result of svyratio
total vector of population totals for the denominator variables in object
se Return standard errors?
... Other unused arguments for other methods

Value

svyratio returns an object of class svyratio. The predict method returns a matrix of population totals and optionally a matrix of standard errors.

Author(s)

Thomas Lumley

References

Levy and Lemeshow. "Sampling of Populations" (3rd edition). Wiley

See Also

svydesign

Examples

data(scd)

## survey design objects
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")

# use BRR replicate weights from Levy and Lemeshow
repweights<-2*cbind(c(1,0,1,0,1,0), c(1,0,0,1,0,1), c(0,1,1,0,0,1),
c(0,1,0,1,1,0))
scdrep<-svrepdesign(data=scd, type="BRR", repweights=repweights)

# ratio estimates
svyratio(~alive, ~arrests, design=scddes)
svyratio(~alive, ~arrests, design=scdnofpc)
svyratio(~alive, ~arrests, design=scd2brr)
svyratio(~alive, ~arrests, design=scdrep)


[Package survey version 2.9-1 Index]