TL;DR
This paper investigates which distance metrics are most effective for identifying similar patients in hierarchical medical data, specifically within the THIN database. By comparing traditional geometric and Hamming metrics with hierarchical-specific pq-gram and Edit Distance metrics, the authors found that while all metrics could identify some similarities, geometric and Hamming metrics were more straightforward for this particular dataset, especially when clustering.
What Problem Does This Paper Address?
In medical databases like THIN, patient data is often structured hierarchically (e.g., using medical codes that form a tree-like classification). Identifying patients with similar conditions or treatment responses is crucial for tasks like detecting adverse drug effects. However, choosing the right "distance metric" to quantify similarity between patients is challenging. Traditional metrics like Euclidean distance work well for non-hierarchical data but may not capture the nuances of hierarchical structures. Conversely, metrics designed for hierarchical data, like pq-gram and Edit Distance, can be computationally complex and sensitive to parameter choices. This paper aims to bridge this gap by comparing these different types of metrics on a real-world hierarchical medical dataset to determine their utility for patient similarity and clustering.
Methods
The researchers applied six different distance metrics to the THIN database:
- Geometric Metrics: Euclidean, Minkowski, and Manhattan distances. These were applied to data converted into frequency tables, representing symptom occurrences for each patient.
- Hamming Distance: Also applied to frequency tables, measuring differences in symptom presence.
- Hierarchical Metrics: PQ-gram and Edit Distance. For these, patient data was transformed into tree structures, reflecting the hierarchical nature of medical codes.
After calculating distances between all pairs of patients for each metric, the distances were normalized to a 0-1 scale to facilitate comparison. Finally, the k-means clustering algorithm was used with three clusters to evaluate how well each distance metric could group similar patients.
Datasets
The primary dataset used is the The Health Improvement Network (THIN) database. This is an anonymized electronic healthcare database containing longitudinal records from general practices across the UK. The paper specifically focuses on data for patients aged 0-17 years who were prescribed either DESLORATADINE (an antihistamine) or DOXEPIN (an antidepressant). The data includes patient demographics, drug prescriptions, and associated symptoms represented by "read codes," which form a hierarchical structure.
Key Insights and Ideas
- Two Groups, Different Strengths: The study clearly shows that metrics designed for hierarchical data (pq-gram, Edit Distance) and those for non-hierarchical data (geometric, Hamming) behave differently when applied to hierarchical medical records.
- Simplicity Wins for Clustering: For the specific THIN data used, the simpler geometric and Hamming metrics were more effective at identifying clearly separated clusters of similar patients when used with k-means clustering.
- PQ-gram Sensitivity: The pq-gram metric's performance is highly dependent on parameter choices (p and q) and the tree structure. While it can highlight some similarities, it's more sensitive to structural differences and can sometimes fail to find obvious similarities that simpler metrics do.
- Data Sparsity Matters: The paper suggests that a lack of data (as seen with the DOXEPIN drug) can lead to fewer identified similarities, even with sophisticated metrics.
Key Results
- Geometric/Hamming Metrics: These metrics consistently identified patients with zero normalized distance, indicating perfect similarity in their symptom profiles (as represented in the frequency tables). They also resulted in well-defined clusters in the k-means analysis, with a large group of similar patients (Cluster 1).
- PQ-gram/Edit Distance Metrics: These metrics produced fewer instances of zero distance. While they could identify some similar patients, their results were less clear-cut, and the clustering often showed less distinct groupings compared to geometric/Hamming metrics. For the DOXEPIN drug, pq-gram and Edit Distance metrics sometimes showed a distance of 1, indicating no similarity, even for patients who might have shared some medical events.
- Clustering Performance: Tables VI and VII show that for DESLORATADINE, Euclidean, Minkowski, and Manhattan metrics grouped a substantial number of patients into Cluster 1 (similar). For DOXEPIN, these metrics also performed well, though the overall number of patients was smaller. PQ-gram and Edit Distance metrics, while identifying some similar patients, tended to place fewer patients in Cluster 1 and more in "other" clusters.
Limitations and Future Work
- Data Structure Choice: The paper highlights that the choice of data representation (tree vs. frequency table) significantly impacts metric performance. The authors suggest that a mixed data structure might be beneficial for future work.
- Parameter Tuning: The pq-gram metric's effectiveness is heavily reliant on parameter selection (p and q), which requires further investigation.
- Limited Data: The study acknowledges that the limited data for the DOXEPIN drug might have influenced the results, particularly for the hierarchical metrics.
- Clustering Algorithm: While k-means was used, the authors note that more advanced clustering techniques or a deeper analysis of cluster assignments could provide further insights.
- Future Directions: The paper suggests exploring mixed data structures and further tuning of hierarchical metric parameters to better leverage the hierarchical nature of medical data for similarity analysis and adverse drug event detection.
Summary updated