svyPVpm | R Documentation |
This function estimates mean, standard deviation and proportion of subsets based on a survey design and plausible values.
svyPVpm(by, svydat, pvs, colN = FALSE)
by |
A formula statement is expected which splits the data into several subsets. Means and proportions will be estimated within these subsets. |
svydat |
A survey design which was generated by the |
pvs |
A character vector which includes the colnames of the plausible
values. These variables must be part of the survey design comitted as
|
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. |
All variables, including the subsetting ones defined with by
, must be
part of the survey design object.
Missing values are deleted listwise.
Note that '.' is not allowed as part of the level string of a by
variable. For example c("1.thing","2.thing") is not allowed and will cause a
error message.
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. |
pvs_mean |
Shows the mean estimate of plausible values within each group. |
pvs_mean.SE |
Denotes the Standard error of the mean estimate. |
pvs_stddev |
Shows the standard deviation (sd) estimate of plausible values within each group. |
pvs_stddev.SE |
Denotes the Standard error of the sd 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.
svyPVglm
svyPVprob
data(svy_example1)
erg_pm <- svyPVpm(by = ~ sex, svydat=svy.exrep, pvs=c("plaus1","plaus2","plaus3"))
erg_pm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.