Skip to contents

Case Weights for Unbalanced Binomial or Categorical Responses

Usage

case_weights(x = NULL)

Arguments

x

(required, integer, character, or factor vector) binomial, categorical, or factor response variable. Default: NULL

Value

numeric vector: case weights

Examples

 case_weights(
   x = c(0, 0, 0, 1, 1)
   )
#> 
#>         0         0         0         1         1 
#> 0.3333333 0.3333333 0.3333333 0.5000000 0.5000000 

 case_weights(
   x = c("a", "a", "b", "b", "c")
   )
#> 
#>   a   a   b   b   c 
#> 0.5 0.5 0.5 0.5 1.0