Calibrate | R Documentation |
Calibrate
Creates a sampling weight based on raking/calibration. Raking is used if it can be used (i.e.,
no numeric adjustment variables and always.calibrate
not FALSE
)
Calibrate(
categorical.variables = NULL,
categorical.targets = NULL,
numeric.variables = NULL,
numeric.targets = NULL,
lower = NA,
upper = NA,
trim.iterations = 20,
package = c("CVXR", "survey", "icarus")[1],
always.calibrate = FALSE,
subset = NULL,
input.weight = NULL
)
categorical.variables |
An optional list or data frame of categorical adjustment variables. |
categorical.targets |
The target probabilities for each category listed in |
numeric.variables |
An optional list or data frame of categorical adjustment variables. |
numeric.targets |
the target mean for each numeric variable in numeric.variables |
lower |
A lower bound weight value (not guaranteed to be achieved). |
upper |
An upper bound weight value (not guaranteed to be achieved). |
trim.iterations |
The number of times to run the trim loop over the final weightings |
package |
The R package used to calibrate the model when raking is not conducted.
Defaults to |
always.calibrate |
If |
subset |
A logical vector indicating which subset of cases should be used to create the weight |
input.weight |
An optional weight variable; if supplied, the created weight is created to be as close to this input.weight as possible |
numeric A vector of weights
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.