calc_weights: Calculate (simple) weights based on the proportion of another...

View source: R/calc_weights.R

calc_weightsR Documentation

Calculate (simple) weights based on the proportion of another variable.

Description

Calculate (simple) weights based on the proportion of another variable.

Usage

calc_weights(data, weight_var, target, weight_label = "weight")

Arguments

data

Data frame or tibble containing the variable used for computing weights

weight_var

The variable to be used for computing the weight

target

A named vector containing the target weights. Names must mtach labels for weight_var

weight_label

A character vector to specify the variable name of the weight variable. Defaults to 'weight'.


martinctc/surveytools documentation built on Nov. 21, 2024, 10:48 p.m.