By: Nabin Won

Data

dat<-read.csv("/Users/nabinwon/Downloads/StressLevelDataset.csv")
head(dat)
##   anxiety_level self_esteem mental_health_history depression headache
## 1            14          20                     0         11        2
## 2            15           8                     1         15        5
## 3            12          18                     1         14        2
## 4            16          12                     1         15        4
## 5            16          28                     0          7        2
## 6            20          13                     1         21        3
##   blood_pressure sleep_quality breathing_problem noise_level living_conditions
## 1              1             2                 4           2                 3
## 2              3             1                 4           3                 1
## 3              1             2                 2           2                 2
## 4              3             1                 3           4                 2
## 5              3             5                 1           3                 2
## 6              3             1                 4           3                 2
##   safety basic_needs academic_performance study_load
## 1      3           2                    3          2
## 2      2           2                    1          4
## 3      3           2                    2          3
## 4      2           2                    2          4
## 5      4           3                    4          3
## 6      2           1                    2          5
##   teacher_student_relationship future_career_concerns social_support
## 1                            3                      3              2
## 2                            1                      5              1
## 3                            3                      2              2
## 4                            1                      4              1
## 5                            1                      2              1
## 6                            2                      5              1
##   peer_pressure extracurricular_activities bullying stress_level
## 1             3                          3        2            1
## 2             4                          5        5            2
## 3             3                          2        2            1
## 4             4                          4        5            2
## 5             5                          0        5            1
## 6             4                          4        5            2

Research Question and Plan

Research Question: Do the students’ psychological, physiological, and academic factors significantly correlate with their stress levels? And if so, which factor from each category correlate to the stress levels the most?

As there are numerous factors that are related to one another, I will be grouping them into larger categories.

Psychological Factors

  1. Anxiety Level
  2. Self Esteem
  3. Mental Health History
  4. Depression

Physiological Factors

  1. Headache
  2. Blood Pressure
  3. Sleep Quality
  4. Breating Problem

Academic Factors

  1. Academic Performance
  2. Study Load
  3. Teacher, Student Relationship
  4. Future Career Concerns

Stress Level

Research Plan

A. The data will be processed, converting the stress_level into a factor through the as.factor() function and extracting null values if necessary.

B. Psychological Factors

H0: There is no correlation between the students’ psychological factors and stress levels.

H1: There is a significant correlation between the students’ psychological factors and stress levels.

  1. Box plots will be utilized to visualize the data for the purpose of observing the general pattern/correlation between the stress level and the psychological factors. Separate box plots will be made for each psychological factor.

  2. After observation, a logistic regression analysis will be conducted to identify the estimate and the p-values of each factor, which will determine the correlation between the psychological factors and stress level. The analysis will also be used to determine which factor among the category correlates the most with the stress levels.

C. Physiological Factors

H0: There is no correlation between the students’ physiological factors and stress levels.

H1: There is a significant correlation between the students’ physiological factors and stress levels.

  1. Each factor under the Physiological category will be converted to a categorical variable through the as.factor() function. The numbers under each factor will also be renamed to describe its severity. (ex.”mild”,“severe”, etc.)

  2. Bar Graphs will be utilized to visualize the data.

  3. Since both the independent and dependent variables are categorical, the Chi-square analysis will be conducted to identify the p-value and determine whether to reject the null hypothesis.

  4. Lastly, multivariate logistic regression analysis will be conducted to determine which factor under the category correlates the most with the stress levels.

D. Academic Factors

H0: There is no correlation between the students’ academic factors and stress levels.

H1: There is a significant correlation between the students’ academic factors and stress levels.

  1. Under each factor, students will be divided into two different groups depending on their score. (The first group will contain students from scores 3-5 while the second group will contain those from 0-2.)

  2. Bar graphs will be utilized to visualize the data.

  3. Chi-squared analysis will be conducted to determine the p-value of each factor.

  4. Lastly, multivariate logistic regression analysis will be conducted to determine which factor under the category correlates the most with the stress levels.

Processing Data

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
stress_level<-dat$stress_level
dat$stress_level<-as.factor(dat$stress_level)

Extracting Null Values

dat<-na.omit(dat)
sum(is.na(dat))
## [1] 0

Investigation of Psychological Factors in Students’ Stress Levels

H0: There is no correlation between the students’ psychological factors and stress levels.(p<0.05)

H1: There is a significant correlation between the students’ psychological factors and stress levels.

Visualization

library(magrittr)
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.3.2
dat %>%
  ggplot(aes(anxiety_level,stress_level))+
  geom_boxplot() + 
  labs(title="Boxplot of Stress and Anxiety Levels",x="Anxiety Level", y="Stress Level")

dat %>%
  ggplot(aes(self_esteem, stress_level))+
  geom_boxplot() + 
  labs(title="Boxplot of Stress Levels and Self Esteem",x="Self Esteem", y="Stress Level")

dat %>%
  ggplot(aes(mental_health_history,stress_level))+
  geom_boxplot() + 
  labs(title="Boxplot of Stress Levels and Mental Health History",x="Mental Health History", y="Stress Level")

dat %>%
  ggplot(aes(depression,stress_level))+
  geom_boxplot() + 
  labs(title="Boxplot of Stress Levels and Depression",x="Depression", y="Stress Level")

Observation

Stress and Anxiety Levels

Through observation, it can be concluded that the placement of the boxplots are gradually moving upwards as the anxiety level increases. For instance, the middle 50% of the data points in stress level 0 are approximately clustered between 3 to 7 in anxiety levels, while the middle 50% for stress level 2 is clustered between 15 and 20. While outliers exist, we can predict that an increase in a student’s anxiety level correlates to an increase in stress.

Stress Level and Self Esteem

The following boxplot depicts a negative correlation between stress level and self esteem; as self esteem increases, stress level decrease. This can be seen by the way in which the placement of the boxplots gradually move downwards from 2 to 0 as self esteem increases.

Stress Level and Mental Health History

It can be observed that stress level correlates strongly with mental health history, as students who doesn’t have a mental health history (0) have low stress levels while the majority of students with a mental health history (1) are located in the second stress level.

Stress Level and Depression

It can be clearly observed that a higher rate in depression is associated with an increase of stress level, as the middle 50% of the data points in stress level 0 is clustered between 0 to 10 in depression, while the middle 50% of data points in stress level 2 are clustered between 15 and 25 in depression.

Logistic Regression Analysis

model <- glm(stress_level ~ anxiety_level + self_esteem + mental_health_history + depression, data = dat, family=binomial())
summary(model)
## 
## Call:
## glm(formula = stress_level ~ anxiety_level + self_esteem + mental_health_history + 
##     depression, family = binomial(), data = dat)
## 
## Coefficients:
##                       Estimate Std. Error z value Pr(>|z|)    
## (Intercept)           -0.71248    0.51661  -1.379 0.167848    
## anxiety_level          0.22467    0.02517   8.927  < 2e-16 ***
## self_esteem           -0.10104    0.01710  -5.909 3.44e-09 ***
## mental_health_history  0.81554    0.23551   3.463 0.000534 ***
## depression             0.10713    0.02025   5.289 1.23e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 1408.95  on 1099  degrees of freedom
## Residual deviance:  660.94  on 1095  degrees of freedom
## AIC: 670.94
## 
## Number of Fisher Scoring iterations: 6

Analysis

Anxiety Level

The student’s anxiety level is strongly correlated with their stress level, as the p-value of 2e-16 is far below the significance value of 0.05. Furthermore, the estimate of the anxiety level is 0.22467, signifying that each unit increase in anxiety level will lead to an increase of stress level by approximately 25%.

Self Esteem

The student’s self esteem is strongly correlated with their stress level, as the p-value of 3.44e-09 is far below the significance value of 0.05. Furthermore, it can be seen that each unit increase in the student’s self esteem leads to a decrease of stress level by 10%.

Mental Health History

The student’s mental health history strongly correlates with their stress level, as the p-value of 0.000534 is below 0.05. Therefore, one can predict that students who have a mental health history increases the stress level by 2.26 times.

Depression

The student’s depression score is strongly correlated to their stress level, as the p-value of 1.23e-07 is below the significance level of 0.05. Therefore, one can predict that each unit increase in depression will lead to an increase in the stress level by 11%.

Strongest Correlation

Mental Health History is the most strongly correlated with stress levels due to its largest coefficient of 0.81554, signifying the most significant influence on stress levels.

Overall, we can reject the null hypothesis and conclude that all four psychological factors strongly correlate to the students’ stress level. Furthermore, mental health history is the most strongly correlated with stress levels among the four psychological factors.

Investigation of Physiological Factors in Students’ Stress Levels

H0: There is no correlation between the students’ physiological factors and stress levels. (p<0.05)

H1: There is a significant correlation between the students’ physiological factors and stress levels.

Data Processing

headache<-as.factor(dat$headache)
blood_pressure<-as.factor(dat$blood_pressure)
sleep_quality<-as.factor(dat$sleep_quality)
breathing_problem<-as.factor(dat$breathing_problem)

dat <- dat %>%
  mutate(headache_label = factor(case_when(
    headache == 0 ~ "None",
    headache == 1 ~ "Very Mild",
    headache == 2 ~ "Mild",
    headache == 3 ~ "Moderate",
    headache == 4 ~ "Severe",
    headache == 5 ~ "Very Severe"
  ), levels=c("None","Very Mild","Mild","Moderate","Severe","Very Severe")))

dat <- dat %>%
  mutate(blood_pressure_label = factor(case_when(
    blood_pressure == 1 ~ "Low",
    blood_pressure == 2 ~ "Medium",
    blood_pressure == 3 ~ "High"
  ), levels=c("Low","Medium","High")))

dat <- dat %>%
  mutate(sleep_quality_label = factor(case_when(
    sleep_quality == 0 ~ "Very Poor",
    sleep_quality == 1 ~ "Poor",
    sleep_quality == 2 ~ "Below Average",
    sleep_quality == 3 ~ "Average",
    sleep_quality == 4 ~ "Good",
    sleep_quality == 5 ~ "Very Good"
  ), levels=c("Very Poor", "Poor", "Below Average", "Average", "Good", "Very Good")))

dat <- dat %>%
  mutate(breathing_problem_label = factor(case_when(
    headache == 0 ~ "None",
    headache == 1 ~ "Very Mild",
    headache == 2 ~ "Mild",
    headache == 3 ~ "Moderate",
    headache == 4 ~ "Severe",
    headache == 5 ~ "Very Severe"
  ), levels=c("None","Very Mild","Mild","Moderate","Severe","Very Severe")))

Visualization

library(dplyr)
summary_dat<-dat %>%
  group_by(headache_label, stress_level) %>%
  summarise(count=n()) %>%
  mutate(percentage=count/sum(count)*100)
## `summarise()` has grouped output by 'headache_label'. You can override using
## the `.groups` argument.
library(ggplot2)
ggplot(summary_dat, aes(x = headache_label, y = percentage, fill = factor(stress_level))) +
  geom_bar(stat = "identity", position = "dodge") +
  labs(x = "Headache", y = "%", fill = "Stress Level") +
  ggtitle("Distribution of Stress Levels by Headache")+
  scale_fill_discrete(labels=c("Low","Medium","High"))

summary_dat<-dat %>%
  group_by(blood_pressure_label, stress_level) %>%
  summarise(count=n()) %>%
  mutate(percentage=count/sum(count)*100)
## `summarise()` has grouped output by 'blood_pressure_label'. You can override
## using the `.groups` argument.
ggplot(summary_dat, aes(x = blood_pressure_label, y = percentage, fill = factor(stress_level))) +
  geom_bar(stat = "identity", position = "dodge") +
  labs(x = "Blood Pressure", y = "%", fill = "Stress Level") +
  ggtitle("Distribution of Stress Levels by Blood Pressure")+
  scale_fill_discrete(labels=c("Low","Medium","High"))

summary_dat<-dat %>%
  group_by(sleep_quality_label, stress_level) %>%
  summarise(count=n()) %>%
  mutate(percentage=count/sum(count)*100)
## `summarise()` has grouped output by 'sleep_quality_label'. You can override
## using the `.groups` argument.
ggplot(summary_dat, aes(x = sleep_quality_label, y = percentage, fill = factor(stress_level))) +
  geom_bar(stat = "identity", position = "dodge") +
  labs(x = "Sleep Quality", y = "%", fill = "Stress Level") +
  ggtitle("Distribution of Stress Levels by Sleep Quality")+
  scale_fill_discrete(labels=c("Low","Medium","High"))

summary_dat<-dat %>%
  group_by(breathing_problem_label, stress_level) %>%
  summarise(count=n()) %>%
  mutate(percentage=count/sum(count)*100)
## `summarise()` has grouped output by 'breathing_problem_label'. You can override
## using the `.groups` argument.
ggplot(summary_dat, aes(x = breathing_problem_label, y = percentage, fill = factor(stress_level))) +
  geom_bar(stat = "identity", position = "dodge") +
  labs(x = "Breathing Problems", y = "%", fill = "Stress Level") +
  ggtitle("Distribution of Stress Levels by Breathing Problems")+
  scale_fill_discrete(labels=c("Low","Medium","High"))

Observation

Headache

It can be seen that no ~ very mild headaches do not have an influence on stress levels, while the increase in the severity of the headache is associated to an increase in stress levels.

Blood Pressure

It can be observed that 100% of students who have low and moderate blood pressure have moderate and low stress levels respectively, while students with high blood pressure are more likely to be affected by high stress levels.

Sleep Quality

The graph depicts that the majority of the students with poor sleeping quality are highly stressed, while most students who sleep below average ~ average are only moderately stressed. On the other hand, it can clearly be seen that the stress level of students with good~very good sleeping quality are low, indicating a strong correlation between sleep quality and stress level.

Breathing Problems

Similar to headaches, there seems to be no correlation between breathing problems and stress level when it is none~very mild. However, it can be observed that the stress level increases as the breathing problem turns from moderate to very severe.

Chi-Squared Analysis

library('gmodels')
## Warning: package 'gmodels' was built under R version 4.3.2
CrossTable(headache,stress_level, chisq =T,
           expected= T, dnn=c("Headache","Stress Level"),prop.r=F, prop.c=F, prop.t=F)
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |              Expected N |
## | Chi-square contribution |
## |-------------------------|
## 
##  
## Total Observations in Table:  1100 
## 
##  
##              | Stress Level 
##     Headache |         0 |         1 |         2 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|
##            0 |        12 |        11 |         9 |        32 | 
##              |    10.851 |    10.415 |    10.735 |           | 
##              |     0.122 |     0.033 |     0.280 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            1 |       312 |        10 |         9 |       331 | 
##              |   112.239 |   107.725 |   111.035 |           | 
##              |   355.531 |    88.654 |    93.765 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            2 |         8 |       167 |         6 |       181 | 
##              |    61.375 |    58.907 |    60.717 |           | 
##              |    46.418 |   198.346 |    49.310 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            3 |        15 |       153 |       119 |       287 | 
##              |    97.319 |    93.405 |    96.275 |           | 
##              |    69.631 |    38.023 |     5.364 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            4 |        13 |         7 |       120 |       140 | 
##              |    47.473 |    45.564 |    46.964 |           | 
##              |    25.033 |    32.639 |   113.584 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            5 |        13 |        10 |       106 |       129 | 
##              |    43.743 |    41.984 |    43.274 |           | 
##              |    21.606 |    24.366 |    90.924 |           | 
## -------------|-----------|-----------|-----------|-----------|
## Column Total |       373 |       358 |       369 |      1100 | 
## -------------|-----------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  1253.627     d.f. =  10     p =  3.885534e-263 
## 
## 
## 
CrossTable(blood_pressure,stress_level, chisq =T,
           expected= T, dnn=c("Blood Pressure","Stress Level"),prop.r=F, prop.c=F, prop.t=F)
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |              Expected N |
## | Chi-square contribution |
## |-------------------------|
## 
##  
## Total Observations in Table:  1100 
## 
##  
##                | Stress Level 
## Blood Pressure |         0 |         1 |         2 | Row Total | 
## ---------------|-----------|-----------|-----------|-----------|
##              1 |         0 |       300 |         0 |       300 | 
##                |   101.727 |    97.636 |   100.636 |           | 
##                |   101.727 |   419.424 |   100.636 |           | 
## ---------------|-----------|-----------|-----------|-----------|
##              2 |       300 |         0 |         0 |       300 | 
##                |   101.727 |    97.636 |   100.636 |           | 
##                |   386.446 |    97.636 |   100.636 |           | 
## ---------------|-----------|-----------|-----------|-----------|
##              3 |        73 |        58 |       369 |       500 | 
##                |   169.545 |   162.727 |   167.727 |           | 
##                |    54.977 |    67.400 |   241.527 |           | 
## ---------------|-----------|-----------|-----------|-----------|
##   Column Total |       373 |       358 |       369 |      1100 | 
## ---------------|-----------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  1570.41     d.f. =  4     p =  0 
## 
## 
## 
CrossTable(sleep_quality,stress_level, chisq =T,
           expected= T, dnn=c("Sleep Quality","Stress Level"),prop.r=F, prop.c=F, prop.t=F)
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |              Expected N |
## | Chi-square contribution |
## |-------------------------|
## 
##  
## Total Observations in Table:  1100 
## 
##  
##               | Stress Level 
## Sleep Quality |         0 |         1 |         2 | Row Total | 
## --------------|-----------|-----------|-----------|-----------|
##             0 |        13 |         9 |        12 |        34 | 
##               |    11.529 |    11.065 |    11.405 |           | 
##               |     0.188 |     0.386 |     0.031 |           | 
## --------------|-----------|-----------|-----------|-----------|
##             1 |         8 |         6 |       314 |       328 | 
##               |   111.222 |   106.749 |   110.029 |           | 
##               |    95.797 |    95.086 |   378.119 |           | 
## --------------|-----------|-----------|-----------|-----------|
##             2 |        13 |       170 |         5 |       188 | 
##               |    63.749 |    61.185 |    63.065 |           | 
##               |    40.400 |   193.520 |    53.462 |           | 
## --------------|-----------|-----------|-----------|-----------|
##             3 |        14 |       144 |        12 |       170 | 
##               |    57.645 |    55.327 |    57.027 |           | 
##               |    33.046 |   142.115 |    35.552 |           | 
## --------------|-----------|-----------|-----------|-----------|
##             4 |       162 |        17 |         9 |       188 | 
##               |    63.749 |    61.185 |    63.065 |           | 
##               |   151.426 |    31.909 |    46.350 |           | 
## --------------|-----------|-----------|-----------|-----------|
##             5 |       163 |        12 |        17 |       192 | 
##               |    65.105 |    62.487 |    64.407 |           | 
##               |   147.197 |    40.792 |    34.894 |           | 
## --------------|-----------|-----------|-----------|-----------|
##  Column Total |       373 |       358 |       369 |      1100 | 
## --------------|-----------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  1520.27     d.f. =  10     p =  1.05483e-320 
## 
## 
## 
CrossTable(breathing_problem,stress_level, chisq =T,
           expected= T, dnn=c("Breathing Problems","Stress Level"),prop.r=F, prop.c=F, prop.t=F)
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |              Expected N |
## | Chi-square contribution |
## |-------------------------|
## 
##  
## Total Observations in Table:  1100 
## 
##  
##                    | Stress Level 
## Breathing Problems |         0 |         1 |         2 | Row Total | 
## -------------------|-----------|-----------|-----------|-----------|
##                  0 |        19 |        13 |        11 |        43 | 
##                    |    14.581 |    13.995 |    14.425 |           | 
##                    |     1.339 |     0.071 |     0.813 |           | 
## -------------------|-----------|-----------|-----------|-----------|
##                  1 |       154 |        13 |        12 |       179 | 
##                    |    60.697 |    58.256 |    60.046 |           | 
##                    |   143.423 |    35.157 |    38.445 |           | 
## -------------------|-----------|-----------|-----------|-----------|
##                  2 |       161 |       148 |        16 |       325 | 
##                    |   110.205 |   105.773 |   109.023 |           | 
##                    |    23.413 |    16.858 |    79.371 |           | 
## -------------------|-----------|-----------|-----------|-----------|
##                  3 |        12 |         8 |       119 |       139 | 
##                    |    47.134 |    45.238 |    46.628 |           | 
##                    |    26.189 |    30.653 |   112.329 |           | 
## -------------------|-----------|-----------|-----------|-----------|
##                  4 |        14 |       165 |       108 |       287 | 
##                    |    97.319 |    93.405 |    96.275 |           | 
##                    |    71.333 |    54.877 |     1.428 |           | 
## -------------------|-----------|-----------|-----------|-----------|
##                  5 |        13 |        11 |       103 |       127 | 
##                    |    43.065 |    41.333 |    42.603 |           | 
##                    |    20.989 |    22.260 |    85.624 |           | 
## -------------------|-----------|-----------|-----------|-----------|
##       Column Total |       373 |       358 |       369 |      1100 | 
## -------------------|-----------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  764.5711     d.f. =  10     p =  8.499267e-158 
## 
## 
## 

Analysis

Headache

There is a significant correlation between headache and stress levels, as the p-value of 3.885534e-263 is below the significance level of 0.05.

Blood Pressure

The student’s blood pressure significantly correlates with their stress levels, as the p-value of 0 is below the significance value of 0.05. Its correlation is not as strong as the headache, however, since the stress levels were lower when the blood pressure was moderate.

Sleep Quality

The student’s sleep quality is significantly correlated to their stress levels, as the p-value of 1.05483e-320 is below the significance level 0.05.

Breathing Problems

The correlation between the student’s breathing problems and their stress levels are the strongest, as the p-value of 8.499267e-158 is far below the significance level of 0.05.

Logistic Regression Analysis (To find which factor is most correlated)

model <- glm(stress_level ~ headache + blood_pressure + sleep_quality + breathing_problem, data = dat,family=binomial())
summary(model)
## 
## Call:
## glm(formula = stress_level ~ headache + blood_pressure + sleep_quality + 
##     breathing_problem, family = binomial(), data = dat)
## 
## Coefficients:
##                   Estimate Std. Error z value Pr(>|z|)    
## (Intercept)        2.09908    0.52289   4.014 5.96e-05 ***
## headache           0.87027    0.08970   9.701  < 2e-16 ***
## blood_pressure    -0.95962    0.14630  -6.559 5.41e-11 ***
## sleep_quality     -0.83451    0.08066 -10.346  < 2e-16 ***
## breathing_problem  0.52604    0.08581   6.130 8.79e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 1408.9  on 1099  degrees of freedom
## Residual deviance:  606.2  on 1095  degrees of freedom
## AIC: 616.2
## 
## Number of Fisher Scoring iterations: 6

Strongest Correlation

Blood Pressure is the most strongly correlated with stress levels due to its largest absolute coefficient of 0.95962, signifying the most significant influence on stress levels.

Investigation of Academic Factors in Students’ Stress Levels

H0: There is no significant correlation between the students’ academic factors and stress levels. (p<0.05)

H1: There is a significant correlation between the students’ academic factors and stress levels.

Data Processing

threshold<-2
academic_performance<-as.factor(dat$academic_performance)
study_load<-as.factor(dat$study_load)
teacher_student_relationship<-as.factor(dat$teacher_student_relationship)
future_career_concern<-as.factor(dat$future_career_concerns)

Visualization

library(magrittr)
library(ggplot2)

dat$performance_labels <- ifelse(dat$academic_performance >= 3, "high", "low")
dat$study_load_labels<- ifelse(dat$study_load >= 3, "high", "low")
dat$relationship_labels<- ifelse(dat$teacher_student_relationship >= 3, "high", "low")
dat$concern_labels<- ifelse(dat$future_career_concerns >= 3, "high", "low")

library(dplyr)
summary_dat<-dat %>%
  group_by(performance_labels, stress_level) %>%
  summarise(count=n()) %>%
  mutate(percentage=count/sum(count)*100)
## `summarise()` has grouped output by 'performance_labels'. You can override
## using the `.groups` argument.
library(ggplot2)
ggplot(summary_dat, aes(x = performance_labels, y = percentage, fill = factor(stress_level))) +
  geom_bar(stat = "identity", position = "dodge") +
  labs(x = "Academic Performance", y = "%", fill = "Stress Level") +
  scale_fill_discrete(labels=c("Low","Medium","High"))

summary_dat<-dat %>%
  group_by(study_load_labels, stress_level) %>%
  summarise(count=n()) %>%
  mutate(percentage=count/sum(count)*100)
## `summarise()` has grouped output by 'study_load_labels'. You can override using
## the `.groups` argument.
ggplot(summary_dat, aes(x = study_load_labels, y = percentage, fill = factor(stress_level))) +
  geom_bar(stat = "identity", position = "dodge") +
  labs(x = "Study Load", y = "%", fill = "Stress Level") +
  scale_fill_discrete(labels=c("Low","Medium","High"))

summary_dat<-dat %>%
  group_by(relationship_labels, stress_level) %>%
  summarise(count=n()) %>%
  mutate(percentage=count/sum(count)*100)
## `summarise()` has grouped output by 'relationship_labels'. You can override
## using the `.groups` argument.
ggplot(summary_dat, aes(x = relationship_labels, y = percentage, fill = factor(stress_level))) +
  geom_bar(stat = "identity", position = "dodge") +
  labs(x = "Teacher-Student Relationship", y = "%", fill = "Stress Level") +
  scale_fill_discrete(labels=c("Low","Medium","High"))

summary_dat<-dat %>%
  group_by(concern_labels, stress_level) %>%
  summarise(count=n()) %>%
  mutate(percentage=count/sum(count)*100)
## `summarise()` has grouped output by 'concern_labels'. You can override using
## the `.groups` argument.
ggplot(summary_dat, aes(x = concern_labels, y = percentage, fill = factor(stress_level))) +
  geom_bar(stat = "identity", position = "dodge") +
  labs(x = "Future Career Concern", y = "%", fill = "Stress Level") +
  scale_fill_discrete(labels=c("Low","Medium","High"))

Observation

Academic Performance

It can be clearly seen that over 60% of students with high academic performance have a low stress level while 60% of students with a low academic performance are highly stressed.

Study Load

It can be observed that over 60% of students who have a high study load are very stressed, while 60% of students with a low study load are under low stress levels.

Teacher-Student Relationship

It can be observed that over 60% of students who have good relationships with their teachers are under low stress levels, while approximately 57% of students who maintain negative relationships with their teachers are highly stressed.

Future Career Concern

The graph clearly portrays that over 60% of students with concerns in their future career are highly stressed, while 60% of students who are less concerned about their career are under low stress levels.

Chi-Squared Analysis

library('gmodels')
CrossTable(dat$academic_performance,stress_level, chisq =T,
           expected= T, dnn=c("Headache","Stress Level"),prop.r=F, prop.c=F, prop.t=F)
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |              Expected N |
## | Chi-square contribution |
## |-------------------------|
## 
##  
## Total Observations in Table:  1100 
## 
##  
##              | Stress Level 
##     Headache |         0 |         1 |         2 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|
##            0 |        11 |         8 |         9 |        28 | 
##              |     9.495 |     9.113 |     9.393 |           | 
##              |     0.239 |     0.136 |     0.016 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            1 |         9 |         9 |       167 |       185 | 
##              |    62.732 |    60.209 |    62.059 |           | 
##              |    46.023 |    43.554 |   177.453 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            2 |        16 |       170 |       162 |       348 | 
##              |   118.004 |   113.258 |   116.738 |           | 
##              |    88.173 |    28.427 |    17.549 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            3 |         8 |       150 |        11 |       169 | 
##              |    57.306 |    55.002 |    56.692 |           | 
##              |    42.423 |   164.079 |    36.826 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            4 |       165 |        12 |        11 |       188 | 
##              |    63.749 |    61.185 |    63.065 |           | 
##              |   160.814 |    39.539 |    42.984 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            5 |       164 |         9 |         9 |       182 | 
##              |    61.715 |    59.233 |    61.053 |           | 
##              |   169.528 |    42.600 |    44.379 |           | 
## -------------|-----------|-----------|-----------|-----------|
## Column Total |       373 |       358 |       369 |      1100 | 
## -------------|-----------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  1144.744     d.f. =  10     p =  1.190004e-239 
## 
## 
## 
CrossTable(dat$study_load_labels,stress_level, chisq =T,
           expected= T, dnn=c("Study Load","Stress Level"),prop.r=F, prop.c=F, prop.t=F)
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |              Expected N |
## | Chi-square contribution |
## |-------------------------|
## 
##  
## Total Observations in Table:  1100 
## 
##  
##              | Stress Level 
##   Study Load |         0 |         1 |         2 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|
##         high |        36 |       177 |       332 |       545 | 
##              |   184.805 |   177.373 |   182.823 |           | 
##              |   119.817 |     0.001 |   121.724 |           | 
## -------------|-----------|-----------|-----------|-----------|
##          low |       337 |       181 |        37 |       555 | 
##              |   188.195 |   180.627 |   186.177 |           | 
##              |   117.658 |     0.001 |   119.530 |           | 
## -------------|-----------|-----------|-----------|-----------|
## Column Total |       373 |       358 |       369 |      1100 | 
## -------------|-----------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  478.7316     d.f. =  2     p =  1.108558e-104 
## 
## 
## 
CrossTable(dat$relationship_labels,stress_level, chisq =T,
           expected= T, dnn=c("Teacher-Student Relationship","Stress Level"),prop.r=F, prop.c=F, prop.t=F)
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |              Expected N |
## | Chi-square contribution |
## |-------------------------|
## 
##  
## Total Observations in Table:  1100 
## 
##  
##                              | Stress Level 
## Teacher-Student Relationship |         0 |         1 |         2 | Row Total | 
## -----------------------------|-----------|-----------|-----------|-----------|
##                         high |       320 |       161 |        34 |       515 | 
##                              |   174.632 |   167.609 |   172.759 |           | 
##                              |   121.008 |     0.261 |   111.450 |           | 
## -----------------------------|-----------|-----------|-----------|-----------|
##                          low |        53 |       197 |       335 |       585 | 
##                              |   198.368 |   190.391 |   196.241 |           | 
##                              |   106.529 |     0.229 |    98.115 |           | 
## -----------------------------|-----------|-----------|-----------|-----------|
##                 Column Total |       373 |       358 |       369 |      1100 | 
## -----------------------------|-----------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  437.5921     d.f. =  2     p =  9.50775e-96 
## 
## 
## 
CrossTable(dat$concern_labels,stress_level, chisq =T,
           expected= T, dnn=c("Future Career Concerns","Stress Level"),prop.r=F, prop.c=F, prop.t=F)
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |              Expected N |
## | Chi-square contribution |
## |-------------------------|
## 
##  
## Total Observations in Table:  1100 
## 
##  
##                        | Stress Level 
## Future Career Concerns |         0 |         1 |         2 | Row Total | 
## -----------------------|-----------|-----------|-----------|-----------|
##                   high |        38 |       174 |       332 |       544 | 
##                        |   184.465 |   177.047 |   182.487 |           | 
##                        |   116.293 |     0.052 |   122.497 |           | 
## -----------------------|-----------|-----------|-----------|-----------|
##                    low |       335 |       184 |        37 |       556 | 
##                        |   188.535 |   180.953 |   186.513 |           | 
##                        |   113.784 |     0.051 |   119.853 |           | 
## -----------------------|-----------|-----------|-----------|-----------|
##           Column Total |       373 |       358 |       369 |      1100 | 
## -----------------------|-----------|-----------|-----------|-----------|
## 
##  
## Statistics for All Table Factors
## 
## 
## Pearson's Chi-squared test 
## ------------------------------------------------------------
## Chi^2 =  472.53     d.f. =  2     p =  2.462693e-103 
## 
## 
## 

Analysis

Academic Performance

We can reject the null hypothesis that there is no difference in the mean of the two groups, as the p-value of 4.887796e-109 is below the significance value of 0.05. Thus, higher-achieving students experience less anxiety than those who are under-achieving.

Study Load

We can reject the null hypothesis that there is no difference in the mean of the two groups, as the p-value of 1.108558e-104 is below the significance value of 0.05. Thus, an increase in study loads is significantly associated with an increase in stress levels.

Teacher-Student Relationship

We can reject the null hypothesis that there is no difference in the mean of the two groups, as the p-value of 9.50775e-96 is below the significance value of 0.05. Therefore, a positive relationship with teachers correlates to a decrease in stress levels while a negative relationship is associated with an increase in the stress levels of the student.

Future Career Concern

We can reject the null hypothesis that there is no difference in the mean of the two groups, as the p-value of 2.462693e-103 is below the significance value of 0.05. Therefore, a higher concern in one’s future career is correlated to an increase in stress.

Logistic Regression Analysis

model <- glm(stress_level ~ academic_performance + study_load + teacher_student_relationship + future_career_concerns, data = dat,family=binomial())
summary(model)
## 
## Call:
## glm(formula = stress_level ~ academic_performance + study_load + 
##     teacher_student_relationship + future_career_concerns, family = binomial(), 
##     data = dat)
## 
## Coefficients:
##                              Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                    2.1597     0.5852   3.691 0.000224 ***
## academic_performance          -0.8845     0.1010  -8.756  < 2e-16 ***
## study_load                     0.5907     0.1049   5.632 1.78e-08 ***
## teacher_student_relationship  -0.4601     0.1009  -4.559 5.13e-06 ***
## future_career_concerns         0.5609     0.1043   5.378 7.52e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 1408.95  on 1099  degrees of freedom
## Residual deviance:  609.23  on 1095  degrees of freedom
## AIC: 619.23
## 
## Number of Fisher Scoring iterations: 6

Strongest Correlation

Future Career Concerns is the most strongly correlated with stress levels due to its largest coefficient of 0.8845.

Conclusion

After data visualization and analysis of psychological, physiological, and academic factors, it can be concluded that the three factors significantly correlate with the students’ stress levels. From the four psychological factors, mental health history showed the strongest positive correlation with stress levels, while blood pressure portrayed the strongest negative correlation from the four physiological factors. Lastly, academic performance depicted the strongest negative correlation with stress levels among the academic factors.