make_heterogeneity_data function

Prepare heterogeneity data