As reported in the article “The Effects of Within-Country Linguistic and Religious Diversity on Foreign Acquisitions” (JIBS, 2016, v47-3: 319-346) two measures of within-country diversity were created using essentially the same data as was used to create the linguistic distance and religious distance scales (see the ‘Psychic Distance’ tab).
In both cases (i.e. for linguistic diversity and religious diversity), the indices are constructed such that a value of 1 represents the situation where no two individuals within the country share the same attribute under investigation (e.g. speak the same language, or adhere to the same religion). Conversely, a value of 0 represents the situation where every individual within the country shares the same attribute (e.g. speaks the same language, or adheres to the same religion).
To represent this mathematically, consider a country with n distinct languages or religions. Let Pi represents the proportion of the population for which language i is their mother tongue, or religion i is their professed religion. The diversity index D is calculated as follows:
D = 1 – (P1 * P1 + P2 * P2 + … + Pn * Pn)
The Excel file at the bottom of this page lists the religious diversity indices and linguistic diversity indices for 120 countries. Please use with appropriate reference to the aforementioned JIBS article. Good luck.