Abstract
In exploratory data analysis, comparing $k$ different groups often results in a combinatorial explosion of pairwise comparisons, leading to uninterpretable results and inconsistent group partitions. We introduce a methodology and an accompanying R package, factorMerger, that treats group comparison as a hierarchical model selection problem. By iteratively fusing groups based on Likelihood Ratio Tests (LRT) and selecting optimal models via Information Criteria, we provide a clear, statistically grounded visualization called the Merging Path Plot. This approach transforms complex post-hoc analyses into intuitive hierarchical clusters, as demonstrated on educational, social, and genomic datasets.
Introduction: The Post-Hoc Paradox
A fundamental task in statistics is determining whether a variable differs across multiple groups. While the standard approach involves a global ANOVA followed by post-hoc pairwise tests (such as Tukey’s HSD), this workflow becomes increasingly problematic as the number of groups ($k$) grows. For instance, comparing 65 countries in the PISA education dataset requires 2,080 pairwise comparisons.
Beyond the sheer volume of data, traditional methods often yield inconsistent results: group A may not differ significantly from B, and B may not differ from C, yet A and C are found to be significantly different. This lack of transitivity makes it nearly impossible to partition the data into meaningful, non-overlapping clusters for reporting or policy-making.
Methodology: Likelihood-Based Fusing
To address these limitations, we propose a framework that treats the comparison of $k$ groups as a hierarchical model selection problem. The process involves three core components:
- Iterative Fusing: The algorithm begins with a "full model" where every group is treated as distinct. It then iteratively merges the two "closest" groups—defined as those whose merger results in the smallest decrease in log-likelihood.
- Likelihood-Based Distance: Unlike traditional clustering methods that rely on Euclidean distance, our method uses the Likelihood Ratio Test (LRT) statistic. This ensures that the merging process is rooted in statistical theory rather than purely geometric heuristics.
- Model Selection via GIC: To determine the optimal number of clusters, we employ the Generalized Information Criterion (GIC). By adjusting the penalty (e.g., AIC for finer detail or BIC for coarser clusters), researchers can identify the model that best balances complexity and fit.
The Merging Path Plot
The primary output of this methodology is the Merging Path Plot. This visualization functions similarly to a dendrogram but uses the horizontal axis to represent the log-likelihood of the model at each stage of the fusion process.
As seen in the figure above, the plot allows researchers to visualize not just which groups are similar, but exactly how much information is lost at each merge. The resulting clusters are nested and non-overlapping, providing a clear hierarchy that is far easier to communicate than a table of thousands of p-values.
Results and Computational Efficiency
The utility of factorMerger was demonstrated across several domains:
- PISA 2012: The tool successfully reduced 11 countries into 4 distinct math performance tiers, clarifying patterns that were obscured in traditional Tukey HSD plots.
- European Social Survey (ESS): The method partitioned 21 countries based on self-reported happiness levels using a binomial model.
- TCGA (The Cancer Genome Atlas): Using Cox proportional hazards models, the tool clustered drug regimens based on patient survival rates.
Computational efficiency is a key feature of the package. While the "fully adaptive" algorithm is highly accurate, it scales at $O(k^3)$. To handle larger datasets, we implemented "fast-fixed" strategies that use preliminary sorting of group effects. For a dataset with 60 groups, the fast-fixed version was approximately 200 times faster than the adaptive version, making the methodology viable for large-scale data applications.
Conclusion
The factorMerger framework and the Merging Path Plot provide a robust alternative to traditional post-hoc testing. By framing group comparison as a hierarchical selection process, we offer researchers a way to find the "signal in the noise" of multi-group datasets. Future work will focus on extending this framework to semi-parametric models and establishing formal consistency theorems for survival analysis applications.
Summary updated