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 NAs with 0 and sets
all weights to 1 if weights is set to NULL.
Usage
check_weights(dep_var, weights)
Value
positive numeric vector of length(dep_var)
containing the checked weights. If weights = NULL, all weights are set to 1.
Arguments
dep_var
dependent variable of distributional function.
Can be any discrete or continuous vector of length 1 or more.
weights
positive numeric vector of length(dep_var)
containing the weights or NULL.