An R package to calculate and decompose entropy-based, multigroup segregation indices, with a focus on the Mutual Information Index (M) and Theil’s Information Index (H).

  • calculate total, between, within, and local segregation
  • decompose differences in total segregation over time
  • estimate standard errors via bootstrapping
  • every method returns a tidy data frame for easy post-processing and plotting
  • it’s fast, because it uses the data.table package internally


The package provides an easy way to calculate segregation measures, based on the Mutual Information Index (M) and Theil’s Entropy Index (H).

Standard errors in all functions can be estimated via boostrapping:

mutual_total(schools00, "race", "school", weight = "n", se = TRUE)
#>   stat   est       se
#> M    M 0.429 0.000935
#> H    H 0.422 0.000985

Decompose segregation into a between-state and a within-state term (the sum of these equals total segregation):

# between states
mutual_total(schools00, "race", "state", weight = "n")
#>   stat    est
#> M    M 0.0992
#> H    H 0.0977

# within states
mutual_total(schools00, "race", "school", within = "state", weight = "n")
#>   stat   est
#> M    M 0.326
#> H    H 0.321

Local segregation (ls) is a decomposition by units (here racial groups). The sum of the proportion-weighted local segregation scores equals M:

Decompose the difference in M between 2000 and 2005, using iterative proportional fitting (IPF) and the Shapley decomposition, as suggested by Karmel and Maclachlan (1988) and Deutsch et al. (2006):

Find more information in the documentation.

How to install

To install the package from CRAN, use


To install the development version, use


Papers using the Mutual information index

(list incomplete)

DiPrete, T. A., Eller, C. C., Bol, T., & van de Werfhorst, H. G. (2017). School-to-Work Linkages in the United States, Germany, and France. American Journal of Sociology, 122(6), 1869-1938.

Forster, A. G., & Bol, T. (2017). Vocational education and employment over the life course using a new measure of occupational specificity. Social Science Research, 70, 176-197.

Van Puyenbroeck, T., De Bruyne, K., & Sels, L. (2012). More than ‘Mutual Information’: Educational and sectoral gender segregation and their interaction on the Flemish labor market. Labour Economics, 19(1), 1-8.

Mora, R., & Ruiz-Castillo, J. (2003). Additively decomposable segregation indexes. The case of gender segregation by occupations and human capital levels in Spain. The Journal of Economic Inequality, 1(2), 147-179.

References on entropy-based segregation indices

Deutsch, J., Flückiger, Y. & Silber, J. (2009). Analyzing Changes in Occupational Segregation: The Case of Switzerland (1970–2000), in: Yves Flückiger, Sean F. Reardon, Jacques Silber (eds.) Occupational and Residential Segregation (Research on Economic Inequality, Volume 17), 171–202.

Theil, H. (1971). Principles of Econometrics. New York: Wiley.

Frankel, D. M., & Volij, O. (2011). Measuring school segregation. Journal of Economic Theory, 146(1), 1-38.

Mora, R., & Ruiz-Castillo, J. (2009). The Invariance Properties of the Mutual Information Index of Multigroup Segregation, in: Yves Flückiger, Sean F. Reardon, Jacques Silber (eds.) Occupational and Residential Segregation (Research on Economic Inequality, Volume 17), 33-53.

Mora, R., & Ruiz-Castillo, J. (2011). Entropy-based Segregation Indices. Sociological Methodology, 41(1), 159–194.

Karmel, T. & Maclachlan, M. (1988). Occupational Sex Segregation — Increasing or Decreasing? Economic Record 64: 187-195.

Watts, M. The Use and Abuse of Entropy Based Segregation Indices. Working Paper. URL: