svyPVquantile: Quantile estimation

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/svyPVquantile.R

Description

This function estimates quantiles of plausible values within groups.

Usage

1
svyPVquantile(by, svydat, pvs, quantile, interval.type = "quantile", colN=FALSE, ...)

Arguments

by

A formula statement is expected which splits the data into several subsets. Within these subsets the quantiles are estimated.

svydat

A survey design (svydesign as well as svrepdesign) which was generated by the survey package. To figure out how to create a survey design object, please read the help files for the survey package.

pvs

A character vector which includes the colnames of the plausible values. These variables must be part of the survey design comitted as svydat.

quantile

A numeric vector of length > 1 which contains the quantiles of interest.

interval.type

A character vector of length = 1 which denotes the kind of quantile estimation method. Valid inputs are: "quantile" and "probability" if a svrepdesign was submitted and in case of a oridinary survey design the valid inputs are: "Wald", "score" and "betaWald". More information about the different estimation techniques can be gained from the "Details" section of the svyquantile function in the survey package.

...

More arguments which are forwarded to svyquantile.

colN

If TRUE the colnames will equal the grouping variable names from the by statement. If FALSE, which is the default, the names will be Group1 up to Group k.

Value

The function returns a data.frame with the following columns

Group1..k

The first k columns show the different levels of the k subsetting groups.

Number.of.cases

Shows the unweighted number of cases (NA's excluded) within each group.

Sum.of.weights

Shows the sum of weights (NA's excluded) within each group.

q0...

These columns contain the quantile values which were estimated by means of the submitted plausible values.

Author(s)

Manuel Reif

References

Lumley, T. (2010). Complex Surveys. Hoboken, NJ: Wiley.

Saerndal, C.-E. & Swensson, B. & Wretman, J. (1992). Model Assisted Survey Sampling. New York: Springer.

Chaudhuri, A. & Stenger, H. (2005). Survey Sampling. Theory and Methods. Boka Raton, FL: Chapman & Hall/CRC.

See Also

svyPVpm

Examples

1
2
3
4
5
6
data(svy_example1)

erg_q <- svyPVquantile(by = ~ sex, svydat=svy.exrep,
pvs=c("plaus1","plaus2","plaus3"), quantile=c(0.2,0.7))

erg_q

manuelreif/svyPVpack documentation built on May 21, 2019, 11:26 a.m.