View source: R/check_weights.R
check_weights | R Documentation |
Helper function to check a weights vector. Makes sure the weights
are positive numeric values (not all zeros) and of the same length as the
dependent variable dep_var
. Replaces all NA
s with 0 and sets
all weights to 1 if weights is set to NULL.
check_weights(dep_var, weights)
dep_var |
dependent variable of distributional function. Can be any discrete or continuous vector of length 1 or more. |
weights |
positive numeric vector of |
positive numeric vector of length(dep_var)
containing the checked weights. If weights = NULL
, all weights are set to 1.
dep_var <- c(1, 3, 9, 16, 3, 7, 4, 9)
weights <- c(2, 1, 3, 4, 4, 1, 6, 3)
check_weights(dep_var, weights)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.