Description Usage Arguments Details Value
View source: R/combine_weighting_functions.R
With multi-stage sampling, it is sometimes necessary to combine the weights from two sampling frames (e.g. stratified cluster sampling). This function let's you create a new weight function from two existing weight functions created with weighting_fun_from_samplingframe().
1 | combine_weighting_functions(weights_function_1, weights_function_2)
|
weights_function_1 |
The weight function from the outer sampling frame (the 'larger' scale; Records in one group of the outer sampling frame can belong to different strata in the inner sampling frame.) |
weights_function_2 |
The weight function from the inner sampling frame (the 'smaller' scale; Records in the same group of the inner sampling frame must also belong to the same group in the outer sampling frame.) |
The returned function combines two sets of weights so that
the sum of weights of each sampling frame's groups remain proportional to each other
the total sum of weights equals the number of rows in the input data frame
returns a function that takes a dataframe as input and returns a vector of weights
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.