standardize_weights: Standardize weights

Description Usage Arguments Value Examples

View source: R/standardize_weights.R

Description

Divides each weight by the mean and converts missing weights to 0. The resulting weights will have a mean of 1 and sum to either the nominal sample size or the effective sample size, which is the nominal sample size divided by the Kish (1965) approximation of an overall survey design effect

Usage

1
standardize_weights(weight, to_ess = FALSE, na_to_zero = TRUE)

Arguments

weight

A vector of weights. Coerced to numeric if a different type.

to_ess

Should the weights sum to the effective sample size? Defaults to FALSE.

na_to_zero

Should missing weights become zero weights? Defaults to TRUE.

Value

A vector of standardized weights.

Examples

1
2
3

pewresearch/pewmethods documentation built on March 27, 2020, 7:22 p.m.