svyPVprob | R Documentation |
This function was created to estimate the proportions of weighted observations within each group.
svyPVprob(by, svydat, pvs = NULL, colN = FALSE)
by |
A formula statement is expected which splits the data into several subsets. |
svydat |
A survey design ( |
pvs |
Either a character vector which contains variablenames (these
variables must exist within the survey) or a vector of length 1 which
contains NULL. If plausible values (or any other variablenames) are provided
by the argument |
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. |
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. |
Proportion |
Shows the (weighted) estimated proportion of persons within the categories. |
Proportion.SE |
Shows the Standard Errors of the proportion estimate. |
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.
svyPVprob
data(svy_example1)
erg_p <- svyPVprob(by = ~ sex, svydat=svy.exrep, pvs=c("plaus1","plaus2","plaus3"))
erg_p
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.