H.se: Shannon information entropy

Description Usage Arguments Value Note Author(s) Examples

View source: R/mes.R

Description

Compute the Shannon information entropy (H statistic)

Usage

1
H.se(X)

Arguments

X

a vector of frequencies.

Value

A numeric value is returned up to -log2(K) where K = the number of unique data values $>0$.

Note

See qualvar package for other indicies of qualitative variation. H.se produces same output as qualvar(X)*log2(K).

Author(s)

Nathaniel Mercaldo

Examples

1
2
3
4
5
6
7
set.seed(1) 
dat <- table(rpois(1000, lambda=1))

H.se(dat)

library(qualvar)
HREL(dat)*log2(length(dat))

mercaldo/mes documentation built on May 22, 2019, 6:51 p.m.