# The Comprehensive Effect of Depression, Anxiety, and Headache on Pain Intensity and Painkiller Use in Patients with Headache Analyzed by Unsupervised Clustering Using Machine Learning

**Authors:** Jong-Ho Kim, Minha Ahn, Jong-Hee Sohn, Sung-Mi Hwang, Jae-Jun Lee, Young-Suk Kwon

PMC · DOI: 10.3390/biomedicines13061345 · Biomedicines · 2025-05-30

## TL;DR

This study uses machine learning to group headache patients based on depression, anxiety, and quality of life, finding distinct clusters with different pain intensity and painkiller use patterns.

## Contribution

The novel use of unsupervised clustering to analyze the combined psychological and functional impact on headache patients.

## Key findings

- K-means clustering identified two groups with significant differences in pain intensity and painkiller use.
- t-SNE + HDBSCAN clustering revealed four groups, with clusters 2 and 3 showing higher pain intensity and more frequent painkiller use.
- Clustering successfully captured comprehensive profiles of depression, anxiety, and headache-related quality of life.

## Abstract

Background/Objectives: Patients with headache experience depression, anxiety, and reduced quality of life, which are individually associated with pain intensity and painkiller use, but their comprehensive combined effect remains unclear. Methods: Comprehensive patient groups were formed based on unsupervised clustering using machine learning algorithms, and their associations were analyzed via ordinary least square regression. K-means and t-distributed stochastic neighbor embedding (t-SNE) combined with hierarchical density-based spatial clustering of applications with noise (HDBSCAN) were applied for clustering. Results: A total of 813 patients were subdivided via K-means clustering (2 clusters) and t-SNE + HDBSCAN clustering (4 clusters). In the K-means clustering, Cluster 1 showed significantly lower peak pain intensity (coefficient [95% CI]: −0.7 [−1 to −0.4]) and frequency of painkiller use (−2.3 [−3.4 to −1.3]) compared to Cluster 0. In the t-SNE + HDBSCAN clustering, Clusters 2 and 3 showed higher peak pain intensity (1.1 [0.5–1.7] and 1.6 [1.0–2.2], respectively) and more frequent painkiller use (2.5 [0.4–4.5] and 4.4 [2.2–6.7], respectively) than Cluster 1. Conclusions: The clustering approach successfully generated groups that reflected a comprehensive profile of depression-, anxiety-, and headache-related quality of life. The clusters demonstrated significant differences which can help better characterize patients based on their psychological and functional impact.

## Full-text entities

- **Diseases:** Pain (MESH:D010146), Depression (MESH:D003866), Headache (MESH:D006261), Anxiety (MESH:D001007)
- **Chemicals:** Painkiller (MESH:D008691)
- **Species:** Homo sapiens (human, species) [taxon 9606]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12189409/full.md

## Figures

9 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12189409/full.md

## References

64 references — full list in the complete paper: https://tomesphere.com/paper/PMC12189409/full.md

---
Source: https://tomesphere.com/paper/PMC12189409