Calculate the normalized entropy for a categorical variable.
Source:R/calc_normalized_entropy.R
calc_normalized_entropy.RdThis function takes a categorical variable as input and calculates the normalized entropy of the variable. The normalized entropy is a measure of the amount of uncertainty or randomness in the variable, normalized to the maximum possible entropy for the variable.
Examples
if (FALSE) {
# Calculate the normalized entropy of a vector of categorical data
x <- c("A", "B", "B", "C", "C", "C", "D", "D", "D", "D")
calc_normalized_entropy(x)
}