November 18, 2025

Wellness Sync

Start the Day with a Smile, Finish with Health

Mental health across contexts: a cross-dataset study covering medical students, quarantined individuals, and psychiatric disordered subjects

Mental health across contexts: a cross-dataset study covering medical students, quarantined individuals, and psychiatric disordered subjects

We conducted a comprehensive analysis across three distinct datasets, encompassing a total of 2629 participants. We present the detailed demographic, behavioral, and mental health characteristics obtained from these groups.

Demographic influences on mental health

Demographic factors such as age, education, and gender are key factors in shaping mental health outcomes. Understanding how these variables interact with mental health across different contexts provides valuable insights into the specific challenges faced by various groups. In this section, we examine the impact of age, education, and gender on mental health by analyzing patterns across our three datasets: Medical student mental health, Mental health depression during quarantine life, and Identification of major psychiatric disorders.

Age-related findings

Our analysis reveals that age significantly influences mental health experiences across all three datasets, though the nature of this influence varies by context. Although direct age-related results were challenging to interpret due to limited age variability among medical students in the “Medical student mental health” dataset, progression through curriculum years allows us to deduce age-related trends. As students advance in their training, empathy levels increase for both males (Slope = 1.59) and females (Slope = 1.48), while behavioral empathy shows a slight decline (Males: Slope = −0.16; Females: Slope = −0.03). Interestingly, cynicism levels also rise over time (Males: Slope = 0.33; Females: Slope = 0.14), showing an age-related trend in emotional and professional experiences. Figure 1 highlights these trends, showing that while empathy increases, both depression and anxiety slightly decrease over time, with female students consistently reporting higher empathy scores. The propensity score matching (PSM) analysis showed that curriculum year significantly impacts mental health outcomes, with higher depression (t = −3.84), increased empathy (t = 3.18), and higher anxiety (t = −2.66) among medical students. To maintain consistency for cross-dataset comparison, we also categorized ages into broader groups and included this additional analysis as a supplementary figure (Supplementary Fig. 1). Detailed results of the PSM analysis—including t-values, confidence intervals, and significance levels for each outcome—are provided in Supplementary Table 4, which is included in the Supplementary File under the ‘Propensity Score Matching (PSM) Analysis’ section. To address potential endogeneity concerns regarding the effect of age on mental health outcomes, we employed a two-stage least squares (2SLS) instrumental variable (IV) approach. In our model, age is treated as the endogenous regressor and is instrumented by year, while controlling for language (glang), partnership status (part), employment (job), study hours (stud_h), self-reported health (health), and psychometric scores (psyt). The IV estimation results indicate that age has a statistically significant effect on several mental health outcomes. For depression, the coefficient on age is −0.98 (t = −4.74, p < 0.001), suggesting that an additional year in age is associated with a reduction in depression scores by ~0.98 units. Similarly, for anxiety, the coefficient on age is −0.47 (t = −2.14, p = 0.032), indicating that increasing age corresponds with a significant decrease in anxiety. In contrast, for total empathy, the coefficient on age is 1.37 (t = 7.09, p < 0.001), demonstrating that older students exhibit higher empathy levels. However, for efficacy, the effect of age is not statistically significant (coefficient = 0.08, t = 0.89, p = 0.371), suggesting no meaningful association between age and perceived efficacy. These results indicate that later-year students have significantly lower depression and anxiety scores, as well as higher total empathy scores compared to early-year students.

Fig. 1
figure 1

Trends in total empathy, depression, and anxiety across different curriculum years, separated by gender (Dataset: Medical student mental health (Carrard et al. 2022)).

The “Mental health depression during quarantine life” dataset reveals a statistically significant association between age and social weakness (p = 0.038). The distribution of social weakness varies across age groups, with the highest proportion of individuals reporting social weakness observed in the 25–30 age group. This finding highlights a potential increased vulnerability specifically during the transition from young adulthood to later adulthood, rather than suggesting a linear increase with advancing age. Figures 2 and 3 illustrate this relationship across different age groups. Additionally, a near-significant association between age and days spent indoors (p = 0.064) hints at age-related differences in quarantine behaviors. To further assess whether these associations reflect a causal effect after accounting for potential confounders, we conducted a propensity score matching (PSM) analysis. The t-test for social weakness yielded a t-value of 2.35 (p = 0.0189), indicating a statistically significant difference between the matched groups. In contrast, the difference in Days Indoors (t = 1.95, p = 0.0511) was only marginally significant. These findings suggest that after balancing on key covariates, individuals in the later age groups exhibit slightly higher levels of social weakness and tend to spend more days indoors during quarantine compared to those in the younger age groups. Detailed results of the PSM analysis are provided in Supplementary Table 6, which is included in the Supplementary File under the ‘Propensity score matching (PSM) analysis’ section.

Fig. 2
figure 2

Stacked bar plot of age by social weakness (Dataset: Mental health depression during quarantine life (Amin et al. 2024)).

Fig. 3
figure 3

Contingency table of age and social weakness (Dataset: Mental health depression during quarantine life (Amin et al. 2024)).

In the “Identification of major psychiatric disorders” dataset, age significantly influences the occurrence of various mental health issues. Trauma and stress-related disorders (TSD) are more frequently experienced by older individuals (mean age = 36.36 years), while younger individuals (mean age = 25.77 years) are typically observed among healthy controls (HC). Other disorders include addictive disorder (AddiD), anxiety disorder (AnxD), mood disorder (MD), obsessive-compulsive disorder (OCD), and schizophrenia (S). Table 4 illustrates the relationship between these psychiatric disorders and their mean ages. It presents the mean age of participants for each disorder alongside the t-values and p-values from comparisons to the healthy control group. Additionally, ANOVA results indicate significant age differences between groups (F = 8.82, p < 0.0001), with Tukey’s HSD test revealing further age-based distinctions among various disorders. Figure 4 presents a box plot of age distribution across psychiatric disorders, offering a visual representation of both overlaps and unique patterns related to age. The interquartile ranges, medians, and the presence of outliers provide additional insights into the variation in age among individuals with different disorders, highlighting both the commonalities and unique age-related trends across these psychiatric conditions. Furthermore, to assess the causal impact of psychiatric disorder status on age while adjusting for potential confounders, we conducted a propensity score matching (PSM) analysis. In this analysis, individuals with trauma and stress-related disorders (treatment group) were compared to healthy controls (control group) using sex and education as covariates. The matching yielded a mean age difference of 11.34 years between the groups. An independent t-test revealed a t-value of 8.54 (p < 0.0001), confirming that, even after controlling for confounding variables, individuals with trauma and stress-related disorders are significantly older than healthy controls.

Table 4 Mean age by disorder group (Dataset: Identification of major psychiatric disorders (Park et al. 2021).
Fig. 4
figure 4

Box plot showing age distribution by psychiatric disorder (Dataset: Identification of major psychiatric disorders (Park et al. 2021)).

Gender-related findings

In the medical student mental health and quarantine life dataset, differences between men and women were particularly noticeable.

Within the “Medical student mental health” dataset, we observe distinct gender-specific trends. While total empathy increases over time for both genders, males show a slightly higher rate of growth. In contrast, behavioral empathy exhibits a small decline for both genders, although this decrease is more pronounced in males. Notably, emotion recognition correlates differently by gender: depression positively correlates with emotion recognition in men but negatively correlates in women. Cynicism levels increase for both genders; however, this increase appears to be more pronounced in men. Differences in academic efficacy are also notable, with men experiencing slight improvements while women face minor declines. Finally, the effects of empathy on mental health vary by gender: affective empathy increases anxiety and despair in women, whereas cognitive empathy reduces anxiety in men. The linear regression slopes, as shown in Table 5, demonstrate how mental health variables change differently for men and women, revealing distinct gender-specific trends across the data. To further validate our associations, we conducted a propensity score matching (PSM) analysis comparing mental health outcomes between genders. In this analysis, we see gender differences significantly affect mental health outcomes, with higher depression (t = 4.30), efficacy (t = 2.70), empathy (t = 3.07), and anxiety (t = 5.45) among medical students (detailed results of PSM analysis are provided in Supplementary Table 5, which is included in the Supplementary File under the ‘Propensity score matching (PSM) analysis’ section).

Table 5 Regression slopes, t-values, and 95% confidence intervals (CI) for mental health indicators by gender.

The analysis of “Mental health depression during quarantine life” dataset reveals a statistically significant association between gender and coping difficulties during quarantine (χ2 = 4.125, P-value = 0.042). Specifically, a higher percentage of women (39%) reported difficulties coping with everyday issues compared to men (32%). This suggests that women may have faced greater challenges in managing everyday issues during quarantine compared to men. Although not highly significant (χ2 = 4.716, p = 0.095), females are more likely to report increased stress during quarantine. Moreover, there is a near-significant association indicating that women may undergo more significant changes (χ2 = 5.823, P-value = 0.054). Figure 5 shows the gender comparisons for both growing stress and coping struggles during quarantine, highlighting the differences in how various genders experienced stress and dealt with struggles during the same period. To further assess the effect of gender on these outcomes while adjusting for potential confounders, we conducted a propensity score matching (PSM) analysis. After matching, the comparison of the outcome Coping Struggles yielded a t-value of 3.21 (p = 0.0014), while the outcome Growing Stress resulted in a t-value of −0.87 (p = 0.3870). These results are summarized in Supplementary Table 7.

Fig. 5: Gender comparisons of mental health during quarantine (Dataset: Mental health depression during quarantine life (Amin et al. 2024)).
figure 5

a shows gender-wise responses to increasing stress during quarantine, categorized into Yes, Maybe, and No. Female participants reported more frequent experiences of growing stress than males. b presents gender-wise differences in coping struggles, comparing how males and females responded to difficulties in managing daily challenges during the quarantine period. A higher proportion of females reported coping struggles compared to males.

In the “Identification of major psychiatric disorders” dataset, we observe that, except for trauma and stress-related disorders, the number of male patients is higher across the remaining six disorders, as shown in Fig. 6. However, despite this distribution, we do not find any significant correlation between gender and mental health. To fully understand the impact of gender on mental health in this dataset, further studies or additional data are required.

Fig. 6
figure 6

Bar chart showing the distribution of male and female patients by psychiatric disorder (Dataset: Identification of major psychiatric disorders (Park et al. 2021)).

Educational background influences

As medical students progress through their training, several measures of their mental health and academic performance change in different ways, as observed through the analysis of curriculum-year-based trends in the “Medical student mental health” dataset. Notably, changes in academic efficacy differ based on gender. While total empathy and cynicism tend to increase with advancing curriculum years, behavioral empathy shows a decline. As discussed earlier, curriculum year indirectly reflects age and accumulated educational experiences. Thus, these findings suggest that the medical education process itself, along with age-related experiences, plays a vital role in shaping students’ mental health outcomes and professional attitudes. Figure 7 illustrates the relationship between academic efficacy and various mental health indicators (depression, anxiety, exhaustion, and cynicism) across genders. As the figure demonstrates, the connection between academic efficacy and these mental health measures not only varies by indicators but also differs between genders.

Fig. 7: Relationship between academic efficacy and mental health indicators by gender (Dataset: Medical student mental health (Carrard et al. 2022)).
figure 7

a Scatterplot of academic efficacy vs. depression, color-coded by gender. A negative trend is observed: higher depression scores are associated with lower efficacy. b Scatterplot of efficacy vs. anxiety shows a similar inverse relationship, with males and females distributed differently along the axis of anxiety. c Scatterplot of efficacy vs. exhaustion indicates that students with higher exhaustion scores report lower academic efficacy. d Scatterplot of efficacy vs. cynicism reveals that increased cynicism is associated with reduced academic efficacy, with gender-specific clustering across efficacy levels.

In the “Mental health depression during quarantine life” dataset, the data do not explicitly address educational background. However, future studies should explore how education influences mental health during quarantine.

The “Identification of major psychiatric disorders” dataset reveals that higher levels of education are associated with improved mental health outcomes. For instance, healthy controls have the highest average education level (14.91 years), while people with schizophrenia show the lowest (12.84 years). The ANOVA results show significant differences in education levels (F = 7.33, p < 0.0001), with Tukey’s HSD test confirming notable differences between healthy controls and various disorders, especially schizophrenia. Table 6 presents the association between different psychiatric disorders and mean education levels. The table displays the mean years of education for each disorder along with the corresponding t-values and p-values from t-tests against the healthy control group. Furthermore, to assess whether the observed differences in education levels persist after adjusting for potential confounders, we conducted a propensity score matching (PSM) analysis comparing individuals with schizophrenia (treatment group) to healthy controls (control group). Using sex and age as covariates, the matching procedure yielded a matched sample in which the mean difference in education was −2.23 years. An independent t-test produced a t-value of −6.64 (p < 0.0001), indicating that, even after adjusting for confounders, individuals with schizophrenia have significantly lower educational attainment compared to healthy controls.

Table 6 Mean education years by disorder group (Dataset: Identification of major psychiatric disorders (Park et al. 2021).

These analyses reveal the nuanced and sometimes unexpected ways that age, education, and gender interact to shape mental health outcomes across different contexts. To highlight the key insights, Table 7 provides a summary of the most important findings from our datasets, emphasizing the complexity of demographic influences on mental health.

Table 7 Summary of important findings from the datasets.

Impact of mental health issues on performance

Mental health issues such as depression, anxiety, and exhaustion significantly impact both academic and work performance. Our analysis across three distinct datasets reveals that the nature and extent of this impact vary depending on the context, be it medical school, quarantine conditions, or broader psychiatric conditions.

In the “Medical student mental health” dataset, mental health problems are tightly interrelated. Anxiety and depression show a high connection (72%), while depression strongly correlates with exhaustion (61%), and exhaustion links with anxiety (53%). These statistics highlight the frequent co-occurrence of these mental health challenges. Notably, these issues negatively influence academic efficacy. For instance, anxiety (−46%), exhaustion (−48%), and cynicism (−57%) all correlate with lower academic efficacy, indicating that as these mental health issues increase, academic performance tends to decrease. Figure 8 highlights these connections, emphasizing how mental health challenges are often interconnected and affect academic success. Interestingly, gender differences further influence these relationships. For male students (−52%), anxiety has a stronger negative impact on academic performance compared to females (−45%), whose academic performance only slightly decreases over time. Conversely, cynicism tends to rise more in males as time goes on. These patterns suggest that while mental health issues harm all genders academically, the effects manifest differently based on gender.

Fig. 8
figure 8

Correlation heatmap among health issues and academic efficacy (Dataset: Medical student mental health (Carrard et al. 2022)).

In our analysis of the “Mental health depression during quarantine life” dataset, we find that gender has a significant impact on how people cope with mental health challenges during the COVID-19 quarantine. Women report greater coping difficulties, higher stress levels, and more significant weight changes compared to men. These findings suggest that the quarantine worsens existing mental health issues for women, leading to a greater negative impact on their work performance. Table 8 summarizes these gender differences. Additionally, frustrations during quarantine weakly correlate with past mental health issues and social vulnerability, with p-values of 0.098 and 0.059. This suggests that people with a history of mental health problems or greater social weakness may be more susceptible to increased frustration, further affecting their interest and performance at work during difficult times such as quarantine.

Table 8 Gender differences in mental health during quarantine (Dataset: Mental health depression during quarantine life (Amin et al. 2024)).

In our study of the “Identification of major psychiatric disorders” dataset, we explore the connections between mental health, education, and cognitive functioning, which may indirectly impact work performance(Lerner and Henke, 2008). Age emerges as a critical factor, with older individuals more likely to have trauma and stress-related disorders. Education also plays a significant role, with healthy controls tending to have higher levels of education, while individuals with schizophrenia exhibit the lowest levels of educational attainment. IQ further contributes to these distinctions, with healthy controls exhibiting higher IQ scores, reflecting better cognitive functioning. Although our dataset does not contain direct measures of work performance, these factors—education and IQ—are often associated with an individual’s ability to perform in academic or professional settings (Strenze, 2007). Figure 9 presents a box plot, displaying the IQ distribution across different psychiatric disorders, illustrating cognitive differences associated with various mental health conditions. The plot shows median IQ scores, interquartile ranges, and potential outliers for each disorder group, providing a clear view of cognitive functioning across these psychiatric categories.

Fig. 9
figure 9

Box plot showing IQ distribution by psychiatric disorder (Dataset: Identification of major psychiatric disorders (Park et al. 2021)).

Thus, the connection between mental health and performance is multifaceted, influenced by factors such as age, gender, education, and the specific challenges of quarantine or academic stress. Table 9 presents a summary of the interactions between mental health issues and performance in various contexts, including medical education, COVID-19 quarantine, and psychiatric diseases. The most vital signs of mental health such as depression, anxiety, exhaustion, trouble adjusting, weight changes, and IQ levels are included in the table. Understanding these characteristics enables the design of specific strategies to assist individuals in coping with mental health issues either in their workplace and educational environment.

Table 9 Summary of relationships between mental health issues and performance in various contexts.

Network analysis across datasets

In this section, we explore the network relationships among various attributes in the three datasets. By analyzing the correlation and association networks, we gain a clearer view of how different variables are interconnected.

In the “Medical student mental health” dataset, we identify strong interconnections among mental health and academic factors through a correlation-based network analysis. Notably, three distinct maximal cliques emerge in the network. The first clique consisting of five entities—depression, anxiety, cynicism, efficacy, and exhaustion—forms a completely interconnected sub-network. This clique highlights the strong interrelationship between mental health issues and their impact on academic efficacy. The second clique includes depression, anxiety, and affective empathy, highlighting how emotional response links with common mental health challenges. The third clique involves total empathy, cognitive empathy, and affective empathy, reflecting the internal cohesion among different empathy types. The maximum clique within this dataset is the first one, indicating the most significant subset of correlated mental health issues. Figure 10a visualizes the correlation network, while Fig. 10b highlights the maximal and maximum cliques.

Fig. 10: Network analysis of mental health variables in the medical student dataset.
figure 10

a Correlation network of key variables (e.g., depression, anxiety, empathy, efficacy), where edge color (green/red) indicates positive/negative correlations and thickness reflects strength. b Maximal cliques (purple) within the network; the largest (blue) clique highlights strong interconnections among depression, anxiety, exhaustion, cynicism, and efficacy, underscoring their impact on academic performance.

In the Mental Health Quarantine dataset, the association network reveals several significant connections between categorical variables. Multiple small maximal cliques are identified, including [Social Weakness, Age], [Social Weakness, Quarantine Frustrations], [Coping Struggles, Gender], [Growing Stress, Changes Habits], [Days Indoors, Age], [Weight Change, Occupation], and [Weight Change, Gender]. Although these cliques are small in size, they indicate important associations between social and mental health variables during the quarantine period. Figure 11a shows the association network, with thicker edges representing stronger associations.

Fig. 11: Network analysis of mental health variables in the quarantine and psychiatric disorders datasets.
figure 11

a Association network from the quarantine dataset based on chi-square values, where edge thickness indicates the strength of association between categorical variables (e.g., stress, age, gender, coping struggles). b Correlation network from the psychiatric disorders dataset, where green/red edges show positive/negative correlations and thickness reflects strength; smaller cliques reveal key links (e.g., Age–Education, Disorder–IQ).

For the “Identification of major psychiatric disorders” dataset, the correlation network shows several notable connections among key demographic and clinical variables. Maximal cliques of size two include relationships such as [Education, Age], [Education, IQ], [Main Disorder, Age], and [Main Disorder, IQ]. Although the cliques are small, they reveal important links between educational attainment, cognitive function, and psychiatric disorders. Figure 11b illustrates the correlation network, showing both positive and negative relationships between these attributes.

Machine learning analysis for capturing non-linear interactions

In order to explore non-linear interactions among demographic factors and mental health outcomes, we applied machine learning models to each of our three datasets. Specifically, we used Random Forest regression for continuous outcomes and a Random Forest classifier for categorical outcomes. The key performance metrics are summarized in Table 10.

Table 10 Summary of machine learning model performance for capturing non-linear interactions across datasets.

These results indicate that Random Forest models capture non-linear patterns in our data, albeit with modest predictive performance. Given the limited sample sizes, the performance metrics are within the expected ranges for complex mental health outcomes. Moreover, these analyses complement our primary econometric methods and provide additional insights into the interaction effects among demographic factors and mental health outcomes. Detailed model specifications, hyperparameter tuning results, and additional diagnostics are provided in the Supplementary Material.

Intersectional analysis and Bayesian modeling

To capture potential non-linear interactions and intersectional effects on mental health outcomes, we extended our analyses by incorporating interaction terms into our regression models and re-estimated them using a Bayesian framework. For the Medical Student Mental Health dataset, our model for depression included interactions among curriculum year, sex, study hours (stud_h), and stress (psyt). The OLS results (Table 11) indicate that, while the main effects of year and sex are statistically significant, most of the interaction terms (e.g., sex:stud_h:psyt) are not significant individually. The Bayesian analysis, which provides posterior estimates and credible intervals, confirms these findings and quantifies the uncertainty in the estimates.

Table 11 Summary of key interaction effects from intersectional regression models across datasets.

In the Mental Health Depression During Quarantine Life dataset, we modeled the outcome Social Weakness using interactions among Age, Gender, and Growing Stress. Although the overall model explained a modest portion of the variance (R2 = 0.030), one interaction term (Age × Growing Stress for a particular age group) was significant (t = 2.11, p = 0.035), indicating that the impact of growing stress on social weakness may vary by age.

Similarly, in the Identification of Major Psychiatric Disorders dataset, an OLS regression predicting education incorporated interactions among age, sex, and disorder status. The results (Table 11) show that age and sex are significant predictors of educational attainment, and the interaction between age and sex, although not highly significant (t = 1.75, p = 0.080), suggests that the effect of age on education may differ by gender.

link