Data reduction for categorical data: an explained heterogeneity approach