Academic pressure, financial stress, and suicidal thoughts each correlated with depression in a dataset of 27,900 university students. I wanted to know whether a combination of those variables could capture a pattern that any one of them would miss.
Read the full paper (PDF, 28 pages) · Zenodo record and DOI · Code and graphs on GitHub
Finding the axes of variation
Imagine drawing a line through a cloud of points in the direction where the cloud stretches furthest. That line is the first principal component. The second follows the widest remaining spread perpendicular to the first. I used the same construction in 13 dimensions, standardizing each variable first so that its units would not determine its influence.
One of the strongest relationships in the covariance matrix initially looked like a story about employment. Work pressure and job satisfaction had a covariance of 0.772 after standardization. When I went back to the underlying records, only three students reported nonzero work pressure. The shared zeros explained why those two columns moved together. The matrix alone gave no reason to conclude that students enjoyed higher-pressure jobs.
How much can a few components explain?
The component loadings show how much each original variable contributes to each new axis. Variance was spread across the axes. It took nine components to capture 80% of the variation in the student characteristics.
Which component tracks depression?
PCA constructs its axes without seeing the depression label. I compared the resulting component scores with that label afterward. The second component, which weighted academic pressure, financial stress, and suicidal thoughts heavily, had the strongest absolute correlation with depression, about 0.707. It tracked the label more closely than any individual variable in this sample.
A linear fit using that single component gave an in-sample R² of 0.4993. The final plot shows why that number needs context. Students with different depression labels could have similar component scores, particularly where the two distributions overlap. A binary label also leaves the severity of symptoms unmeasured. The study establishes an association in this dataset and leaves open how well it would generalize to other students.