R/calc_weights.R
calc_weights.Rd
Calculate (simple) weights based on the proportion of another variable.
calc_weights(data, weight_var, target, weight_label = "weight")
Data frame or tibble containing the variable used for computing weights
The variable to be used for computing the weight
A named vector containing the target weights. Names must mtach labels for weight_var
A character vector to specify the variable name of the weight variable. Defaults to 'weight'.