Skip to contents

This 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.

Usage

calc_normalized_entropy(x)

Arguments

x

A categorical variable.

Value

The normalized entropy of 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)
}