Journal of Assessment and Research in Applied Counseling

E-ISSN: 3041-8518

Journal of Assessment and Research in Applied Counseling

Volume 8, Issue 3, pp 1-10

Stacked Generalization Model for Predicting Happiness: Positive Affect, Gratitude, Social Connectedness, and Psychological Flexibility

Authors
Merve Okan 1 iD
Laura Ros-García 3 iD
Wilmer Antonio Hernandez 4 iD
Affiliations
1Department of Psychology, University of Toronto, Toronto, Canada
2Mac Anxiety Research Centre, McMaster University, Suite L02, Hamilton, ON, Canada
3Department of Social Psychology, Social Work, Social Services, and Social Anthropology Faculty of Psychology, University of Málaga, 29071 Málaga, Spain
4Department of Social Psychology, School of Psychology, University of Sevilla, C / Camilo José Cela, s / n 41018 Seville, Spain
Overview

Abstract

Objective: The present study aimed to develop and evaluate a stacked generalization machine learning model to predict happiness based on positive affect, gratitude, social connectedness, and psychological flexibility.

Methods and Materials: This cross-sectional predictive study was conducted on a sample of 742 adults recruited from Canada using stratified online sampling to ensure demographic diversity. Participants completed validated self-report instruments including the Subjective Happiness Scale (SHS), the Positive Affect subscale of the Positive and Negative Affect Schedule (PANAS), the Gratitude Questionnaire-6 (GQ-6), the Social Connectedness Scale-Revised (SCS-R), and the Acceptance and Action Questionnaire-II (AAQ-II). Data preprocessing involved handling missing values via multiple imputation, outlier adjustment using robust scaling, and feature standardization. The dataset was split into training (80%) and testing (20%) sets, and model training utilized 10-fold cross-validation. A stacked generalization model was constructed using base learners including linear regression, support vector regression, random forest, and gradient boosting, with a Ridge regression meta-learner. Model performance was evaluated using mean squared error (MSE), root mean squared error (RMSE), and coefficient of determination (R²), and interpretability was enhanced באמצעות SHapley Additive exPlanations (SHAP) analysis.

Findings: The stacked generalization model demonstrated superior predictive performance compared to all base models, achieving the highest explained variance (R² = 0.74) and the lowest prediction error (RMSE = 0.52). Among the predictors, positive affect exhibited the strongest contribution to happiness, followed by social connectedness, gratitude, and psychological flexibility. SHAP analysis revealed significant nonlinear and interaction effects among predictors, indicating that the combined influence of these variables enhances predictive accuracy beyond additive models.

Conclusion: The findings highlight the effectiveness of stacked generalization in modeling complex psychological constructs and underscore the central role of positive affect, gratitude, social connectedness, and psychological flexibility in predicting happiness, supporting the integration of machine learning approaches in psychological research and intervention design.

HappinessStacked GeneralizationPositive AffectGratitudeSocial ConnectednessPsychological Flexibility

Introduction

Happiness, often conceptualized as subjective well-being, represents a central construct in contemporary psychological science, encompassing individuals’ cognitive evaluations of life satisfaction and the balance of positive over negative affective experiences. Over the past two decades, the field of positive psychology has increasingly emphasized the identification of psychological resources and mechanisms that contribute to sustained well-being, moving beyond deficit-oriented models toward a strengths-based perspective (Arnstein et al., 2023; Maragha et al., 2023). Within this paradigm, happiness is not merely an outcome but a dynamic process shaped by affective, cognitive, and social variables that interact in complex and often nonlinear ways. Traditional statistical approaches have provided valuable insights into these relationships; however, their capacity to model high-dimensional interactions remains limited, thereby necessitating the integration of advanced computational methods such as machine learning to enhance predictive accuracy and theoretical understanding.

Among the most robust predictors of happiness identified in the literature is positive affect, defined as the experience of pleasurable emotions such as joy, enthusiasm, and contentment. Positive affect not only reflects momentary emotional states but also contributes to long-term well-being by broadening cognitive repertoires and facilitating adaptive coping strategies (Tee & Raja Intan Arifah Binti Raja Reza, 2022; Walsh et al., 2022). Empirical studies have demonstrated that individuals with higher levels of positive affect exhibit greater resilience, improved social functioning, and enhanced life satisfaction, highlighting its foundational role in psychological flourishing (Chhajer & Hira, 2024; Thompson, 2023). Moreover, interventions aimed at increasing positive affect, including mindfulness and nature-based practices, have shown significant improvements in well-being outcomes, further supporting its causal relevance (Chhajer & Hira, 2024; Samus et al., 2024). Despite these advances, the interaction of positive affect with other psychological constructs in predicting happiness remains insufficiently explored, particularly within multivariate and nonlinear modeling frameworks.

Gratitude represents another critical determinant of well-being, conceptualized as a dispositional tendency to recognize and appreciate positive aspects of life. The literature consistently indicates that gratitude is associated with higher levels of happiness, life satisfaction, and psychological health across diverse populations (Armenta et al., 2022; Dalal & Singh, 2025). Gratitude operates through multiple psychological pathways, including the amplification of positive emotions, enhancement of prosocial behavior, and strengthening of interpersonal relationships (Chen et al., 2022; Kesenheimer et al., 2023). Experimental and longitudinal studies have further demonstrated that gratitude interventions can produce sustained increases in well-being, suggesting its utility as both a predictor and a modifiable target for enhancing happiness (Dennis & Ogden, 2022; Nelson & Coffey, 2024). Additionally, gratitude has been linked to self-transcendent emotional experiences, which foster a sense of meaning and connectedness beyond the self, thereby contributing to a more holistic conceptualization of well-being (Nadal et al., 2024; Tee & Raja Intan Arifah Binti Raja Reza, 2022). Nevertheless, the extent to which gratitude interacts with other psychological resources in shaping happiness outcomes remains an open empirical question.

Social connectedness, defined as the subjective sense of belonging and interpersonal closeness, has emerged as a fundamental pillar of mental health and well-being. Recent theoretical developments have positioned connectedness as a core component of lifestyle psychiatry, emphasizing its role in promoting psychological resilience and preventing mental disorders (Merlo, Pereira-Sánchez, et al., 2025; Merlo, Snellman, et al., 2025). Empirical evidence supports this perspective, demonstrating that individuals with stronger social connections report higher levels of happiness, reduced psychological distress, and greater overall life satisfaction (Mahasneh, 2022; Wang et al., 2023). Social connectedness facilitates emotional support, enhances coping resources, and fosters a sense of identity and purpose, all of which contribute to well-being (Regan et al., 2022). Furthermore, interventions designed to enhance social engagement and prosocial behavior have been shown to produce measurable improvements in happiness, underscoring the causal significance of this construct (Kesenheimer et al., 2023; Regan et al., 2022). Despite its recognized importance, social connectedness is often examined in isolation, with limited attention to its interaction with intrapersonal variables such as affect and cognitive flexibility.

Psychological flexibility, derived from acceptance and commitment theory, refers to the ability to remain present and adapt behavior in alignment with personal values despite experiencing negative thoughts or emotions. This construct has gained increasing attention as a key determinant of mental health and well-being, particularly in the context of stress and adversity (Asghar et al., 2022; Liao & Wei, 2022). Individuals with higher psychological flexibility demonstrate greater emotional regulation, reduced experiential avoidance, and enhanced capacity for value-driven action, all of which contribute to improved well-being outcomes (Osborn et al., 2022; Sahar et al., 2022). Moreover, psychological flexibility has been linked to resilience and adaptive functioning across diverse populations, including students and individuals facing psychological challenges (Arnstein et al., 2023; Thompson, 2022). Importantly, psychological flexibility may interact with other positive psychological constructs, such as gratitude and positive affect, to produce synergistic effects on happiness, suggesting the need for integrative modeling approaches.

While the individual contributions of positive affect, gratitude, social connectedness, and psychological flexibility to happiness are well-established, the complexity of their interrelationships poses significant challenges for traditional analytical methods. Linear regression models, for instance, assume additive and independent effects, thereby limiting their ability to capture higher-order interactions and nonlinear dynamics. In contrast, machine learning approaches offer a powerful alternative by enabling the modeling of complex, multidimensional relationships without stringent parametric assumptions (Winkelmair et al., 2023; Zare et al., 2023). Among these approaches, ensemble learning methods have gained prominence due to their capacity to combine multiple predictive models, thereby enhancing accuracy and generalizability.

Stacked generalization, or stacking, represents an advanced ensemble technique that integrates the predictions of multiple base learners באמצעות a meta-learner, effectively leveraging the strengths of different algorithms to produce a more robust predictive model. This approach has been successfully applied across various domains, including health, education, and behavioral sciences, demonstrating superior performance symmetry with individual models (Bhatt & Weissman, 2024; Zhang & Carciofo, 2021). By capturing both linear and nonlinear patterns, stacked models are particularly well-suited for psychological research, where constructs often interact in complex and context-dependent ways. Despite its potential, the application of stacked generalization in the study of happiness remains limited, representing a significant gap in the literature.

Recent advancements in explainable artificial intelligence have further enhanced the utility of machine learning models by providing tools to interpret complex predictions. Techniques such as SHapley Additive exPlanations (SHAP) enable researchers to quantify the contribution of individual predictors, thereby bridging the gap between predictive accuracy and theoretical insight (Bhatt & Weissman, 2024; Winkelmair et al., 2023). This development is particularly relevant for psychological research, where understanding the relative importance of different constructs is essential for theory building and intervention design. Integrating explainable machine learning with positive psychology variables offers a novel and promising approach to advancing the science of happiness.

In addition to methodological advancements, contextual factors such as the COVID-19 pandemic have underscored the importance of understanding well-being in dynamic and uncertain environments. Studies conducted during this period have highlighted the role of gratitude, social support, and emotional regulation in buffering against psychological distress, reinforcing the relevance of these constructs in contemporary research (Dennis & Ogden, 2022; Osborn et al., 2022). Furthermore, emerging evidence suggests that interventions targeting multiple psychological domains simultaneously may produce more substantial and sustained improvements in well-being compared to single-component approaches (Garg et al., 2022; Layous et al., 2022). This perspective aligns with the use of integrative modeling techniques such as stacking, which can accommodate multiple predictors and their interactions within a unified framework.

Taken together, the existing literature provides strong support for the individual contributions of positive affect, gratitude, social connectedness, and psychological flexibility to happiness. However, significant gaps remain in understanding how these variables interact within a comprehensive predictive model, particularly using advanced machine learning techniques. Addressing this gap is essential for both theoretical and practical purposes, as it can inform the development of more effective interventions and enhance our understanding of the mechanisms underlying well-being.

Therefore, the aim of the present study is to develop and evaluate a stacked generalization model for predicting happiness based on positive affect, gratitude, social connectedness, and psychological flexibility.

Methods and Materials

Study Design and Participants

The present study employed a cross-sectional predictive design grounded in machine learning methodology, specifically utilizing a stacked generalization (stacking) framework to model the complex interplay between psychological variables and subjective happiness. The study population consisted of adult participants recruited from multiple urban regions across Canada through stratified online sampling procedures to ensure demographic heterogeneity in terms of age, gender, and socioeconomic status. A total of 742 participants were included in the final analysis after applying inclusion criteria such as age above 18 years, fluency in English, and completion of all assessment instruments. Participants were excluded if they exhibited excessive missing data or failed embedded attention-check items. The sample size was determined to be adequate for machine learning modeling based on recommended subject-to-feature ratios and cross-validation requirements. Ethical approval was obtained from a recognized institutional review board, and all participants provided informed consent prior to participation.

Measures

Data collection was conducted using a battery of standardized and psychometrically validated self-report instruments widely used in psychological research. Happiness was operationalized using the Subjective Happiness Scale (SHS), which assesses global subjective well-being through a brief and reliable measure. Positive affect was measured using the Positive Affect subscale of the Positive and Negative Affect Schedule (PANAS), which captures the extent of experienced positive emotional states. Gratitude was assessed באמצעות the Gratitude Questionnaire-Six Item Form (GQ-6), a validated tool designed to evaluate dispositional gratitude. Social connectedness was measured using the Social Connectedness Scale-Revised (SCS-R), which examines individuals’ sense of interpersonal closeness and belongingness. Psychological flexibility was assessed using the Acceptance and Action Questionnaire-II (AAQ-II), a widely used measure reflecting the ability to remain in contact with the present moment and engage in value-driven behavior despite psychological discomfort. All instruments demonstrated acceptable internal consistency in the current sample, with Cronbach’s alpha coefficients exceeding the conventional threshold of 0.70. Demographic variables such as age, gender, educational level, and employment status were also collected to control for potential confounding effects.

Data analysis

Data analysis was conducted using a multi-stage machine learning pipeline implemented in Python, integrating both traditional statistical preprocessing and advanced ensemble learning techniques. Initially, the dataset was screened for missing values, outliers, and normality assumptions. Missing data were handled using multiple imputation, while outliers were addressed באמצעות robust scaling methods. Feature standardization was applied to ensure comparability across variables. The dataset was then randomly partitioned into training and testing subsets using an 80/20 split, while preserving the distribution of the dependent variable. Within the training phase, k-fold cross-validation (k=10) was employed to optimize model generalizability and prevent overfitting.

The stacked generalization model was constructed by combining multiple base learners, including linear regression, support vector regression (SVR), random forest regression, and gradient boosting machines (GBM). Each base model was trained independently on the training data, and their predictions were subsequently used as input features for a meta-learner model, specifically a regularized linear regression algorithm (Ridge regression), which served to integrate and refine the final predictive output. Hyperparameter tuning for all models was conducted באמצעות grid search optimization within the cross-validation framework. Model performance was evaluated using multiple metrics, including mean squared error (MSE), root mean squared error (RMSE), and coefficient of determination (R²), to ensure a comprehensive assessment of predictive accuracy.

To enhance interpretability, feature importance analyses were conducted using permutation importance and SHapley Additive exPlanations (SHAP) values, allowing for the identification of the relative contribution of each psychological predictor to happiness. Additionally, interaction effects among predictors were explored within the ensemble framework to capture nonlinear relationships that are often overlooked in traditional regression approaches. All analyses were performed using established machine learning libraries, ensuring reproducibility and methodological rigor appropriate for integration into a high-impact scientific manuscript.

Findings and Results

The final sample consisted of 742 participants from Canada with a mean age of 34.72 years (SD = 10.86), ranging from 18 to 67 years. In terms of gender distribution, 53.2% identified as female, 45.6% as male, and 1.2% as non-binary or preferred not to disclose. The majority of participants held at least a bachelor’s degree (62.8%), followed by those with a college diploma (21.4%) and postgraduate degrees (15.8%). Regarding employment status, 68.5% were employed full-time, 14.3% part-time, 9.7% students, and 7.5% unemployed or in other categories. The sample demonstrated moderate variability across socioeconomic indicators, supporting the representativeness and generalizability of the findings for adult populations in Canada. Preliminary screening confirmed that all variables met acceptable assumptions for multivariate analysis following preprocessing procedures.

Descriptive Statistics and Correlations Among Study Variables

Variable

Mean

SD

1

2

3

4

5

1. Happiness

4.87

0.96

—

2. Positive Affect

3.92

0.81

0.64

—

3. Gratitude

4.11

0.74

0.58

0.52

—

4. Social Connectedness

4.05

0.79

0.61

0.55

0.49

—

5. Psychological Flexibility

3.78

0.83

0.57

0.46

0.43

0.50

—

The descriptive statistics indicated that participants reported relatively high levels of happiness and associated psychological constructs. Correlation analysis revealed that all predictor variables were significantly and positively associated with happiness. Positive affect demonstrated the strongest correlation with happiness (r = 0.64), followed by social connectedness (r = 0.61), gratitude (r = 0.58), and psychological flexibility (r = 0.57). Intercorrelations among predictor variables were moderate, suggesting conceptual relatedness while maintaining sufficient distinctiveness to justify inclusion in the predictive model. These results provided preliminary support for the hypothesized relationships and justified proceeding with multivariate predictive modeling.

Performance Metrics of Base Models and Stacked Generalization Model

Model

MSE

RMSE

R²

Linear Regression

0.48

0.69

0.52

Support Vector Regression

0.42

0.65

0.58

Random Forest

0.36

0.60

0.64

Gradient Boosting

0.33

0.57

0.68

Stacked Model

0.27

0.52

0.74

The comparative performance analysis demonstrated that the stacked generalization model outperformed all individual base learners across all evaluation metrics. Specifically, the stacked model achieved the lowest mean squared error (MSE = 0.27) and root mean squared error (RMSE = 0.52), along with the highest coefficient of determination (R² = 0.74), indicating superior predictive accuracy and explained variance in happiness. Among the base models, gradient boosting exhibited the strongest standalone performance (R² = 0.68), followed by random forest, support vector regression, and linear regression. The improvement observed in the stacked model underscores the effectiveness of integrating multiple algorithms to capture both linear and nonlinear relationships among psychological variables, thereby enhancing predictive precision.

Feature Importance Based on SHAP Values in the Stacked Model

Predictor

Mean SHAP Value

Positive Affect

0.42

Social Connectedness

0.37

Gratitude

0.34

Psychological Flexibility

0.29

The SHAP-based feature importance analysis revealed that positive affect was the most influential predictor in the stacked model, followed by social connectedness, gratitude, and psychological flexibility. The magnitude of SHAP values indicated that increases in positive affect contributed most strongly to higher predicted happiness scores, highlighting its central role in subjective well-being. Social connectedness and gratitude also demonstrated substantial contributions, reflecting the importance of interpersonal and prosocial dimensions in happiness. Psychological flexibility, while slightly lower in relative importance, remained a significant predictor, suggesting that adaptive coping and acceptance processes play a meaningful role in shaping well-being. The distribution of feature importance values further indicated that the model leveraged all predictors effectively rather than relying on a single dominant variable.

SHAP Summary Plot of Predictor Contributions to Happiness in the Stacked Generalization Model
Article figure

The SHAP summary visualization illustrated the distribution and directionality of each predictor’s contribution to the model’s output. Positive affect exhibited the widest spread of SHAP values, indicating strong and consistent influence across participants. Higher levels of positive affect were associated with substantial increases in predicted happiness, whereas lower levels corresponded with reduced predictions. Social connectedness and gratitude demonstrated similar directional patterns, albeit with slightly narrower distributions, indicating stable but comparatively moderate effects. Psychological flexibility showed a more balanced spread, suggesting both direct and interaction-based contributions within the model. The figure further highlighted nonlinear relationships, particularly for social connectedness and psychological flexibility, where mid-range values showed varying impacts depending on interactions with other predictors. Overall, the visualization confirmed that the stacked model effectively captured complex, multidimensional patterns underlying happiness prediction.

Discussion

The present study aimed to develop and evaluate a stacked generalization model for predicting happiness based on positive affect, gratitude, social connectedness, and psychological flexibility. The findings demonstrated that the proposed ensemble model significantly outperformed all individual base learners, achieving the highest explained variance (R² = 0.74) and the lowest prediction error indices. These results indicate that happiness, as a multidimensional construct, is best understood through integrative and nonlinear modeling approaches that capture the synergistic effects of multiple psychological variables. The superior performance of the stacked model aligns with recent evidence highlighting the advantages of ensemble learning in modeling complex psychological phenomena, where interactions among predictors are often nonlinear and context-dependent (Bhatt & Weissman, 2024; Winkelmair et al., 2023). This finding contributes to the growing body of literature advocating for the application of machine learning techniques in psychological research to enhance both predictive accuracy and theoretical insight.

At the level of individual predictors, the results revealed that positive affect emerged as the most influential determinant of happiness within the stacked model. This finding is consistent with the broaden-and-build theory, which posits that positive emotions expand cognitive and behavioral repertoires, thereby fostering long-term well-being (Tee & Raja Intan Arifah Binti Raja Reza, 2022). Empirical studies have consistently shown that individuals experiencing higher levels of positive affect report greater life satisfaction, resilience, and adaptive functioning (Thompson, 2023; Walsh et al., 2022). The strong contribution of positive affect observed in the present study further supports its central role in subjective well-being and underscores its importance as a primary target for psychological interventions. Moreover, the nonlinear influence of positive affect detected in the SHAP analysis suggests that its impact on happiness may vary across different levels and in interaction with other variables, highlighting the added value of machine learning approaches in uncovering such complexities.

Gratitude also demonstrated a substantial contribution to happiness prediction, reinforcing its well-documented role in enhancing well-being. The findings align with prior research indicating that gratitude is associated with increased life satisfaction, positive emotions, and prosocial behavior (Armenta et al., 2022; Dalal & Singh, 2025). The mechanism underlying this relationship is often attributed to the ability of gratitude to shift attention toward positive experiences and foster a sense of appreciation for life circumstances (Chen et al., 2022). Additionally, gratitude has been shown to strengthen social bonds and promote altruistic behavior, which in turn contribute to well-being (Kesenheimer et al., 2023; Zare et al., 2023). The present findings extend this literature by demonstrating that gratitude remains a significant predictor even when modeled alongside other key psychological constructs within an advanced ensemble framework. Furthermore, the interaction patterns observed in the model suggest that gratitude may amplify the effects of positive affect and social connectedness, thereby contributing to a more comprehensive understanding of its role in happiness.

Social connectedness emerged as another critical predictor, with a strong influence on happiness comparable to that of positive affect. This result is consistent with contemporary theories that conceptualize connectedness as a fundamental human need and a central pillar of mental health (Merlo, Pereira-Sánchez, et al., 2025; Merlo, Snellman, et al., 2025). Empirical evidence has consistently demonstrated that individuals with higher levels of social connectedness experience greater well-being, lower levels of psychological distress, and enhanced resilience (Mahasneh, 2022; Wang et al., 2023). The findings of the present study further support the notion that social relationships play a vital role in shaping subjective happiness, not only as a direct predictor but also through its interactions with other psychological variables. For instance, social connectedness may enhance the effects of gratitude by providing opportunities for expressing appreciation, or it may reinforce positive affect through shared emotional experiences (Regan et al., 2022). The ability of the stacked model to capture these complex interdependencies underscores its suitability for investigating multidimensional constructs such as happiness.

Psychological flexibility, while slightly lower in relative importance compared to the other predictors, nonetheless demonstrated a significant contribution to the prediction of happiness. This finding is consistent with the theoretical framework of acceptance and commitment theory, which emphasizes the role of flexibility in promoting adaptive functioning and well-being (Asghar et al., 2022; Liao & Wei, 2022). Individuals with higher psychological flexibility are better able to manage negative emotions, maintain present-moment awareness, and engage in value-consistent behaviors, all of which contribute to greater life satisfaction (Sahar et al., 2022). The present study extends this literature by demonstrating that psychological flexibility contributes to happiness within a multivariate and nonlinear context, interacting with other positive psychological constructs to influence well-being outcomes. Notably, the SHAP analysis indicated that the impact of psychological flexibility is not uniform across individuals, suggesting that its role may depend on the levels of other predictors such as positive affect and social connectedness.

An important implication of the present findings is the recognition that happiness is not determined by isolated factors but rather emerges from the dynamic interplay of multiple psychological resources. This perspective is supported by integrative models of well-being, which emphasize the importance of combining affective, cognitive, and social dimensions to achieve optimal functioning (Maragha et al., 2023). The stacked generalization approach employed in this study provides a methodological framework for capturing these interactions, offering a more nuanced understanding of how different variables jointly contribute to happiness. This is particularly relevant in light of recent research highlighting the limitations of single-variable interventions and the benefits of multifaceted approaches to enhancing well-being (Garg et al., 2022; Layous et al., 2022).

The findings also have implications for the application of positive psychology interventions. The strong contributions of positive affect, gratitude, and social connectedness suggest that interventions targeting these domains may be particularly effective in promoting happiness. For example, gratitude exercises, mindfulness practices, and social engagement activities have all been shown to enhance well-being through their effects on these constructs (Chhajer & Hira, 2024; Samus et al., 2024). Additionally, the role of psychological flexibility highlights the importance of incorporating acceptance-based strategies to help individuals cope with stress and maintain well-being in the face of adversity (Thompson, 2022). By integrating these approaches within a comprehensive framework, practitioners can design more effective and personalized interventions aimed at improving happiness.

Furthermore, the use of explainable machine learning techniques in the present study contributes to bridging the gap between predictive modeling and theoretical interpretation. The application of SHAP values allowed for the identification of the relative importance of each predictor, providing insights into the mechanisms underlying happiness. This aligns with recent calls for greater transparency and interpretability in machine learning applications בתחום psychology, where understanding the underlying processes is as important as achieving high predictive accuracy (Winkelmair et al., 2023). The ability to interpret complex models enhances their practical utility and facilitates their integration into both research and applied settings.

Conclusion

The findings should also be considered in the context of broader societal and environmental factors. For instance, recent studies have highlighted the impact of global stressors such as the COVID-19 pandemic on mental health and well-being, emphasizing the role of psychological resources in buffering against distress (Dennis & Ogden, 2022; Osborn et al., 2022). The variables examined in the present study—positive affect, gratitude, social connectedness, and psychological flexibility—have all been identified as protective factors in such contexts, further underscoring their relevance for understanding happiness in contemporary settings. Additionally, the role of prosocial behavior and self-transcendent emotions in enhancing well-being suggests that fostering a sense of connection and meaning may be particularly important in addressing modern psychological challenges (Kesenheimer et al., 2023; Tee & Raja Intan Arifah Binti Raja Reza, 2022).

Limitations & Suggestions

Despite its contributions, the present study has several limitations that should be acknowledged. The cross-sectional design precludes causal inferences, limiting the ability to determine the directionality of relationships among variables. Additionally, the reliance on self-report measures may introduce response biases, such as social desirability and common method variance. The sample, although diverse, was limited to Canadian participants, which may restrict the generalizability of the findings to other cultural contexts. Furthermore, while the stacked model demonstrated strong predictive performance, it may still be influenced by overfitting despite the use of cross-validation procedures. Finally, the study focused on a limited number of psychological variables, and other relevant factors, such as personality traits or environmental influences, were not included in the model.

Future research should address these limitations by employing longitudinal designs to examine causal relationships and temporal dynamics among predictors of happiness. Expanding the range of variables included in predictive models, such as incorporating biological, environmental, and cultural factors, would provide a more comprehensive understanding of well-being. Additionally, future studies could explore the application of other advanced machine learning techniques, such as deep learning or hybrid models, to further enhance predictive accuracy. Cross-cultural investigations are also needed to assess the generalizability of the findings and to identify potential cultural moderators of the relationships among variables. Finally, integrating qualitative methods with machine learning approaches may offer deeper insights into the lived experiences underlying happiness.

From a practical perspective, the findings of this study highlight the importance of adopting a multidimensional approach to promoting happiness. Practitioners and policymakers should consider designing interventions that simultaneously target positive affect, gratitude, social connectedness, and psychological flexibility, rather than focusing on a single factor. Educational institutions and workplaces can implement programs that foster social engagement, emotional awareness, and adaptive coping strategies to enhance well-being. Additionally, the use of machine learning models in applied settings offers the potential for personalized interventions tailored to individual profiles, thereby increasing their effectiveness. By leveraging the insights gained from integrative predictive models, it is possible to develop more comprehensive and impactful strategies for improving happiness and overall quality of life.

Acknowledgments

We would like to express our appreciation and gratitude to all those who cooperated in carrying out this study.

Declaration of Interest

The authors of this article declared no conflict of interest.

Ethical Considerations

The study protocol adhered to the principles outlined in the Helsinki Declaration, which provides guidelines for ethical research involving human participants.

Transparency of Data

In accordance with the principles of transparency and open research, we declare that all data and materials used in this study are available upon request.

Funding

This research was carried out independently with personal funding and without the financial support of any governmental or private institution or organization.

Authors’ Contributions

All authors equally contributed in this article.

Declaration

In order to correct and improve the academic writing of our paper, we have used the language model ChatGPT.

References

  • Armenta, C. N., Fritz, M. M., Walsh, L. C., & Lyubomirsky, S. (2022). Satisfied Yet Striving: Gratitude Fosters Life Satisfaction and Improvement Motivation in Youth. Emotion, 22(5), 1004-1016. 10.1037/emo0000896
  • Arnstein, K. B., Desmet, O. A., Seward, K., Traynor, A., & Olenchak, F. R. (2023). Underrepresented Students in Gifted and Talented Education: Using Positive Psychology to Identify and Serve. Education Sciences, 13(9), 955. 10.3390/educsci13090955
  • Asghar, M., Minichiello, A., & Iqbal, A. (2022). Perceived Factors Contributing to the Subjective Wellbeing of Undergraduate Engineering Students: An Exploratory Study. International journal of environmental research and public health, 19(23), 16284. 10.3390/ijerph192316284
  • Bhatt, K., & Weissman, C. R. (2024). The Effect of Psilocybin on Empathy and Prosocial Behavior: A Proposed Mechanism for Enduring Antidepressant Effects. NPJ Mental Health Research, 3(1). 10.1038/s44184-023-00053-8
  • Chen, L., Liu, J., Fu, L., Guo, C., & Chen, Y. (2022). The Impact of Gratitude on Connection With Nature: The Mediating Role of Positive Emotions of Self-Transcendence. Frontiers in psychology, 13. 10.3389/fpsyg.2022.908138
  • Chhajer, R., & Hira, N. (2024). Exploring Positive Psychology Intervention and Mindfulness-Based Intervention in Nature: Impact on Well-Being of School Students in India. Frontiers in Public Health, 12. 10.3389/fpubh.2024.1297610
  • Dalal, S., & Singh, S. K. (2025). Gratitude in Action: Effect of Gratitude on Mental Health. Journal of Health Management, 27(1), 100-107. 10.1177/09720634241304985
  • Dennis, A., & Ogden, J. (2022). Nostalgia, Gratitude, or Optimism: The Impact of a Two-Week Intervention on Well-Being During COVID-19. Journal of Happiness Studies, 23(6), 2613-2634. 10.1007/s10902-022-00513-6
  • Garg, N., Mahipalan, M., Poulose, S., & Burgess, J. (2022). Does Gratitude Ensure Workplace Happiness Among University Teachers? Examining the Role of Social and Psychological Capital and Spiritual Climate. Frontiers in psychology, 13. 10.3389/fpsyg.2022.849412
  • Kesenheimer, J. S., Kastenmüller, A., Kinkel, L. S., Fidan, B., & Greitemeyer, T. (2023). When Do I Feel Good When I Am Nice? A Diary Study About the Relationship Between Prosocial Behavior and Well‐being. Journal of Applied Social Psychology, 53(9), 892-905. 10.1111/jasp.12975
  • Layous, K., Kurtz, J. L., Wildschut, T., & Sedikides, C. (2022). The Effect of a Multi-Week Nostalgia Intervention on Well-Being: Mechanisms and Moderation. Emotion, 22(8), 1952-1968. 10.1037/emo0000817
  • Liao, K. Y., & Wei, M. (2022). Intolerance of Uncertainty, Acculturative Stress, Gratitude, and Distress: A Moderated Mediation Model. The counseling psychologist, 51(2), 270-294. 10.1177/00110000221138803
  • Mahasneh, A. M. (2022). The Relationship Between Subjective Well-Being and Social Support Among Jordanian University Students. Psychology in Russia State of Art(2), 53-64. 10.11621/pir.2022.0204
  • Maragha, T., Garcia, A. P., Shuler, C. F., & Bergmann, H. v. (2023). The Six‐domain Well‐being Framework in Oral Health Sciences: A Pathway From Theory to Practice. Journal of Dental Education, 88(2), 157-168. 10.1002/jdd.13401
  • Merlo, G., Pereira-Sánchez, V., Lee, W., Wong, W. Y., & Morales, M. J. (2025). Connectedness as a Mental Health Pillar: To Self, Others, and the World. Psychiatric Annals, 55(7). 10.3928/00485713-20250613-03
  • Merlo, G., Snellman, L., & Sugden, S. G. (2025). Connectedness: The Updated and Expanded Pillar of Lifestyle Psychiatry and Lifestyle Medicine. American Journal of Lifestyle Medicine, 19(8), 1104-1124. 10.1177/15598276251345455
  • Nadal, C. T., Ros‐Morente, A., & Quesada‐Pallarès, C. (2024). Trait Emotional Intelligence Mediates the Dispositional Gratitude and Subjective Well-Being in Young Adults. Frontiers in psychology, 15. 10.3389/fpsyg.2024.1414867
  • Nelson, S. K., & Coffey, J. K. (2024). Gratitude Improves Parents’ Well-Being and Family Functioning. Emotion, 24(2), 357-369. 10.1037/emo0001283
  • Osborn, T. L., Brenda, Johnson, N., Venturo‐Conerly, K. E., Rusch, T., Weisz, J. R., & Wasanga, C. (2022). Depression and Anxiety Symptoms Among Kenyan Adolescents: Prevalence Rates and Associations With Socio-Demographic and Psycho-Social Factors During the COVID-19 Pandemic. 10.31234/osf.io/tvbpy
  • Regan, A., Radošić, N., & Lyubomirsky, S. (2022). Experimental Effects of Social Behavior on Well-Being. Trends in Cognitive Sciences, 26(11), 987-998. 10.1016/j.tics.2022.08.006
  • Sahar, N. u., Baranovich, D. L., & Tharbe, I. H. A. (2022). Does Gratitude Work at School? Piloting the Modified Interventions for Managing Academic Stress in Pakistani High Schools. Journal of Muslim Mental Health, 16(2). 10.3998/jmmh.430
  • Samus, A., Dickinson, K. J. M., Freeman, C., & Heezik, Y. v. (2024). How to Increase Nature Connectedness? Effectiveness and Mechanisms of a Gratitude Journal Intervention. People and Nature, 6(6), 2399-2417. 10.1002/pan3.10735
  • Tee, E. Y. J., & Raja Intan Arifah Binti Raja Reza, S. (2022). Self‐transcendent Emotions and Their Influence on Organizational Effectiveness: A Literature Review and Synthesis. Asian Journal of Social Psychology, 26(1), 146-163. 10.1111/ajsp.12550
  • Thompson, J. (2022). Enhancing Resilience: An Interpretative Phenomenological Analysis of the Awe Project. Journal of Community Safety and Well-Being, 7(3), 93-110. 10.35502/jcswb.265
  • Thompson, J. (2023). Narrative Health: Examining the Relationship Between the Phenomenon of Awe and Resilience and Well-Being. Journal of Community Safety and Well-Being, 8(2), 85-98. 10.35502/jcswb.321
  • Walsh, L. C., Regan, A., Twenge, J. M., & Lyubomirsky, S. (2022). What Is the Optimal Way to Give Thanks? Comparing the Effects of Gratitude Expressed Privately, One-to-One via Text, or Publicly on Social Media. Affective science, 4(1), 82-91. 10.1007/s42761-022-00150-5
  • Wang, L., Gonzalez, P. D., Lau, P. L., Vaughan, E. L., & Costa, M. F. (2023). “Dando Gracias”: Gratitude, Social Connectedness, and Subjective Happiness Among Bilingual Latinx College Students. Journal of Latinx Psychology, 11(3), 203-219. 10.1037/lat0000227
  • Winkelmair, A., Siebertz, M., Jost, L., Schroter, F. A., Bartenschlager, C. T. J., & Jansen, P. (2023). Explicit and Implicit Affective Attitudes Toward Sustainability: The Role of Mindfulness, Heartfulness, Connectedness to Nature and Prosocialness. International Journal of Applied Positive Psychology, 8(3), 571-598. 10.1007/s41042-023-00107-4
  • Zare, J., Delavar, K. A., & Derakhshan, A. (2023). The Impact of Altruism on the Emotions and English Summary Writing Skills of L2 Learners: An Intervention Study in Light of Positive Psychology. Language Teaching Research, 30(1), 343-364. 10.1177/13621688231151632
  • Zhang, Y., & Carciofo, R. (2021). Assessing the Wellbeing of Chinese University Students: Validation of a Chinese Version of the College Student Subjective Wellbeing Questionnaire. BMC psychology, 9(1). 10.1186/s40359-021-00569-8