homogeneity: Calculate homogeneity/heterogeneity

homogeneityR Documentation

Calculate homogeneity/heterogeneity

Description

Calculate a simple index of homogeneity for nominal data, that is variously called Simpson's, Herfindahl's or Hirschman's index.

Usage

homogeneity(x, reverse = F, summary = F)

Arguments

x

(a vector) A vector of values.

reverse

(log scalar) Whether to reverse the index to index heterogeneity (default false).

summary

(log scalar) Whether to treat data as summary statistics of the group proportions (default false). If data are given in 0-100 format, it will automatically convert.

Examples

homogeneity(iris$Species)
homogeneity(iris$Species, reverse = T)
homogeneity(c(.7, .2, .1), summary = T)
homogeneity(c(80, 15, 5), summary = T)

Deleetdk/kirkegaard documentation built on June 7, 2024, 7:49 a.m.