AdjustDataToReflectWeights | R Documentation |
AdjustDataToReflectWeights
Creates a new data.frame
to reflect weights.
AdjustDataToReflectWeights(data, weights, seed = 123, silent = FALSE)
data |
A |
weights |
The sampling or replication weights. |
seed |
The seed used in random number generation. If |
silent |
If |
In situations where an algorithm does not accomodate weights, this
function modifies the data.frame
by either: (A) stretching it
out, where the the weights are integers, or (B) resampling to create a new
bootstrapped data.frame
, where the weights
are
proportional to the probability of selection. When creating the bootstrap
sample, the sample size is whichever is greatest of the rounded sum and 1.
# Inspired by Zelig, 13-11-15.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.