View source: R/svyPVquantile.R
svyPVquantile | R Documentation |
This function estimates quantiles of plausible values within groups.
svyPVquantile(
by,
svydat,
pvs,
quantile,
interval.type = "quantile",
colN = FALSE,
...
)
by |
A formula statement is expected which splits the data into several subsets. Within these subsets the quantiles are estimated. |
svydat |
A survey design ( |
pvs |
A character vector which includes the colnames of the plausible
values. These variables must be part of the survey design comitted as
|
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 |
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. |
... |
More arguments which are forwarded to |
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. |
Manuel Reif
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.
svyPVpm
data(svy_example1)
erg_q <- svyPVquantile(by = ~ sex, svydat=svy.exrep,
pvs=c("plaus1","plaus2","plaus3"), quantile=c(0.2,0.7))
erg_q
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.