Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

entropy

Calculate Shannon entropy


Description

Calculate Shannon entropy, following Tastle and Wierman.

Usage

entropy(V)

Arguments

V

A frequency vector

Details

This function calculates the Shannon entropy following Tastle and Wierman (2007). A frequency vector describes the number of observations in a given category. For example, the vector [10,20,30,15,4] describes 10 observations with position 1, 20 observations with position 2, 30 observations with position 3, 15 observations with position 4, and 4 observations with position 5.

This function follows Tastle and Wierman and ignores categories with zero observations. This does not follow the formula indicated.

See consensus for a function that considers the order of categories.

Value

The function returns the Shannon entropy.

Author(s)

Didier Ruedin

References

Tastle, W., and M. Wierman. 2007. Consensus and dissention: A measure of ordinal dispersion. International Journal of Approximate Reasoning 45 (3): 531-545.

See Also

Examples

# Sample data
V <- c(30,40,210,130,530,50,10)
# Calculate entropy
entropy(V)

agrmt

Calculate Concentration and Dispersion in Ordered Rating Scales

v1.42.4
MIT + file LICENSE
Authors
Didier Ruedin [aut, cre] Clem Aeppli [ctb]
Initial release
2020-08-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.