Description Usage Arguments Details Value Examples
Use bootstrap resampling of survey to find best weighting indicators
1 2 3 4 | choose_best_weighting(inputfile, outputpath, n, response, ...)
choose_best_weighting_(inputfile, outputpath = "./wwc_weighted.csv", n,
response_col, dots)
|
inputfile |
A file containing the input survey data (a survey data
frame, such as that created by |
outputpath |
Path to write a csv file of the output weighted results.
The new file will contain the original survey data with 2 columns added,
|
n |
Number of bootstrap resamplings to generate in order to find the best weighting indicators |
response |
A column in |
... |
Weighting indicator(s) to be tested for post-stratification.
One or more of |
response_col |
Response column as string |
dots |
List of weighting indicator(s) as string(s) |
choose_best_weighting is given bare names while
choose_best_weighting_ is given strings and is therefore suitable for
programming with. One column of the survey data in inputfile must be
geography, to indicate what ACS data to use for post-stratification
weighting.
A list of the best indicators. This function also saves a csv file of the output weighted results
1 2 3 4 |
tmp <- tempfile()
choose_best_weighting(system.file("extdata/examplesurvey.csv", package = "WWC"),
tmp, 5, response, sex, raceethnicity)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.