Intoduction

My project will explore the relationships between Stress and Sleep/GPA

Sleep vs Stress(performance)

#formatting 
data$Stress_Level = factor(
  data$Stress_Level,
  levels = c("Low", "Moderate", "High")
)

ggplot(
  data, 
  aes(
    Sleep_Hours_Per_Day,
    Stress_Level,
   
  ) )+
  geom_boxplot(
    col = "black",
    fill = "steelblue",
    alpha = .5
  )+
  labs(
    title = "Sleep duration by stress level",
    x = "Hours in sleep (per day)",
    y = "Stress Level"
  )+
  theme_minimal()+
   theme(
    plot.title = element_text(size = 16, face = "bold"),
    axis.title = element_text(size = 12)
  )

aggregate(Sleep_Hours_Per_Day ~ Stress_Level, data, mean )
##   Stress_Level Sleep_Hours_Per_Day
## 1          Low            8.063973
## 2     Moderate            7.947626
## 3         High            7.046453

Analysis of Sleep and Stress Levels

The boxplot shows the distribution of sleep duration across different stress levels. Students with low stress levels tend to exhibit higher median sleep duration, while students with high stress levels tend to have lower median sleep.

In addition, the spread of the data indicates that students with higher stress levels show greater variability in sleep duration, as evidenced by the larger IQR and wider range in the boxplot. Contrasting, the data of the low stress students demonstrates a more consistent sleep pattern.

This observation is support by the mean sleep values, where high stress sleep duration is at 7.04 and low stress sleep duration is at 8.06 respectively.

Overall, these results suggest a negative relationship between stress and sleep, where higher stress is associated with both reduced and more variable sleep duration.

Does Sleep Affect GPA?

ggplot(
  data, 
  aes(
   x = GPA, 
   y = Sleep_Hours_Per_Day
  )
)+ 
  geom_point(
        
  )+
  labs(
    title = "Relationship between Sleep and GPA",
    x = "GPA",
    y = "Hours in sleep (per day)"
  )+
  geom_smooth(method = "lm", se = F)+
theme_minimal() +
  theme(
    plot.title = element_text(size = 16, face = "bold"),
   
    axis.title = element_text(size = 12)
  )
## `geom_smooth()` using formula = 'y ~ x'

cor(data$Sleep_Hours_Per_Day, data$GPA)
## [1] -0.004278441

Analysis of Sleep and GPA

The scatterplot shows the relationship between Sleep and GPA. The data points are widely dispersed with no clear upward nor downward trend, suggesting a weak realtionship between these variables. Furthermore, the correlation supports this analysis, with an R value close to 0, (-0.004), thus indicating that sleep duration alone may not be a strong predictor of academic performance. Other factors, such as stress, time management, or study habits may play a more significant role.