Introduction

This report explores sleep patterns in college students using the “SleepStudy” dataset from https://www.lock5stat.com/datapage3e.html. The dataset includes 253 observations across 27 variables and captures various aspects of student life, such as sleep habits, academic performance, mental health, and substance use.

The main objective of this report is to analyze trends and differences in student sleep behaviors, using statistical methods to investigate potential associations between sleep and other lifestyle or academic factors. Through this analysis, we aim to gain insights that can support campus wellness initiatives and inform students about how their habits may impact overall performance and well-being.

The following research questions will guide this analysis:

1. Do students with high anxiety scores have lower average cognition scores?

2. Is there a relationship between the number of drinks per week and depression score?

3. Is there a significant difference in stress levels between students who had at least one all-nighter and those who didn’t?

4. Do students with moderate or high stress report lower average happiness levels?

5. Do students who had at least one early class miss more classes than those who had none?

6. Do students who identify as "larks" have higher average GPA than those who identify as "owls"?

7. Is sleep quality correlated with the number of classes missed?

8. Is there a relationship between the number of drinks per week and the number of classes missed?

9.Do students who report at least one all-nighter sleep less on weekdays compared to those who don’t?

10. Do first- and second-year students sleep more on weekends than upperclassmen?

By addressing these questions, this report aims to identify meaningful patterns and correlations that affect students’ sleep, mental health, and academic outcomes

Data

The dataset used in this analysis, titled SleepStudy, was obtained from Lock5Stat. It contains 253 observations and 27 variables, each capturing various characteristics of college students related to their sleep habits, mental health, academic performance, and lifestyle behaviors.

Key variables include:

GPA and CognitionZscore (academic performance)

LarkOwl and NumEarlyClass (sleep-related metrics)

DepressionScore, AnxietyScore, and StressScore (psychological indicators)

AlcoholUse, Drinks, and AllNighter (behavioral and lifestyle factors)

study = read.csv("https://www.lock5stat.com/datasets3e/SleepStudy.csv")
head(study)
##   Gender ClassYear LarkOwl NumEarlyClass EarlyClass  GPA ClassesMissed
## 1      0         4 Neither             0          0 3.60             0
## 2      0         4 Neither             2          1 3.24             0
## 3      0         4     Owl             0          0 2.97            12
## 4      0         1    Lark             5          1 3.76             0
## 5      0         4     Owl             0          0 3.20             4
## 6      1         4 Neither             0          0 3.50             0
##   CognitionZscore PoorSleepQuality DepressionScore AnxietyScore StressScore
## 1           -0.26                4               4            3           8
## 2            1.39                6               1            0           3
## 3            0.38               18              18           18           9
## 4            1.39                9               1            4           6
## 5            1.22                9               7           25          14
## 6           -0.04                6              14            8          28
##   DepressionStatus AnxietyStatus Stress DASScore Happiness AlcoholUse Drinks
## 1           normal        normal normal       15        28   Moderate     10
## 2           normal        normal normal        4        25   Moderate      6
## 3         moderate        severe normal       45        17      Light      3
## 4           normal        normal normal       11        32      Light      2
## 5           normal        severe normal       46        15   Moderate      4
## 6         moderate      moderate   high       50        22    Abstain      0
##   WeekdayBed WeekdayRise WeekdaySleep WeekendBed WeekendRise WeekendSleep
## 1      25.75        8.70         7.70      25.75        9.50         5.88
## 2      25.70        8.20         6.80      26.00       10.00         7.25
## 3      27.44        6.55         3.00      28.00       12.59        10.09
## 4      23.50        7.17         6.77      27.00        8.00         7.25
## 5      25.90        8.67         6.09      23.75        9.50         7.00
## 6      23.80        8.95         9.05      26.00       10.75         9.00
##   AverageSleep AllNighter
## 1         7.18          0
## 2         6.93          0
## 3         5.02          0
## 4         6.90          0
## 5         6.35          0
## 6         9.04          0

Analysis

1. Do students with high anxiety scores have lower average cognition scores?

study$AnxietyGroup <- ifelse(study$AnxietyScore >= 15, "High", "Normal")
t.test(CognitionZscore ~ AnxietyGroup, data = study)
## 
##  Welch Two Sample t-test
## 
## data:  CognitionZscore by AnxietyGroup
## t = 0.80809, df = 16.366, p-value = 0.4306
## alternative hypothesis: true difference in means between group High and group Normal is not equal to 0
## 95 percent confidence interval:
##  -0.2862442  0.6399414
## sample estimates:
##   mean in group High mean in group Normal 
##           0.16562500          -0.01122363

2. Is there a relationship between the number of drinks per week and depression score?

cor.test(study$Drinks, study$DepressionScore)
## 
##  Pearson's product-moment correlation
## 
## data:  study$Drinks and study$DepressionScore
## t = -0.18172, df = 251, p-value = 0.8559
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.1346071  0.1120169
## sample estimates:
##         cor 
## -0.01146949

3. Is there a significant difference in stress levels between students who had at least one all-nighter and those who didn’t?

# Compare stress scores based on all-nighter status
t.test(StressScore ~ AllNighter, data = study)
## 
##  Welch Two Sample t-test
## 
## data:  StressScore by AllNighter
## t = -0.27114, df = 42.827, p-value = 0.7876
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  -3.481572  2.656431
## sample estimates:
## mean in group 0 mean in group 1 
##        9.410959        9.823529

4. Do students with moderate or high stress report lower average happiness levels?

# Keep only Lark and Owl entries (exclude "Neither")
study_larkowl <- subset(study, LarkOwl %in% c("Lark", "Owl"))

# Run t-test on filtered data
t.test(CognitionZscore ~ LarkOwl, data = study_larkowl)
## 
##  Welch Two Sample t-test
## 
## data:  CognitionZscore by LarkOwl
## t = 0.80571, df = 75.331, p-value = 0.4229
## alternative hypothesis: true difference in means between group Lark and group Owl is not equal to 0
## 95 percent confidence interval:
##  -0.1893561  0.4465786
## sample estimates:
## mean in group Lark  mean in group Owl 
##         0.09024390        -0.03836735

5. Do students who had at least one early class miss more classes than those who had none?

t.test(ClassesMissed ~ EarlyClass, data = study)
## 
##  Welch Two Sample t-test
## 
## data:  ClassesMissed by EarlyClass
## t = 1.4755, df = 152.78, p-value = 0.1421
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  -0.2233558  1.5412830
## sample estimates:
## mean in group 0 mean in group 1 
##        2.647059        1.988095

6. Do students who identify as “larks” have higher average GPA than those who identify as “owls”?

# Filter out "Neither" from LarkOwl variable
study_larkowl <- subset(study, LarkOwl %in% c("Lark", "Owl"))

# Compare GPA between Larks and Owls
t.test(GPA ~ LarkOwl, data = study_larkowl)
## 
##  Welch Two Sample t-test
## 
## data:  GPA by LarkOwl
## t = 1.5176, df = 87.507, p-value = 0.1327
## alternative hypothesis: true difference in means between group Lark and group Owl is not equal to 0
## 95 percent confidence interval:
##  -0.04156192  0.31004375
## sample estimates:
## mean in group Lark  mean in group Owl 
##           3.330976           3.196735

7. Is sleep quality correlated with the number of classes missed?

cor.test(study$PoorSleepQuality, study$ClassesMissed)
## 
##  Pearson's product-moment correlation
## 
## data:  study$PoorSleepQuality and study$ClassesMissed
## t = 4.9605, df = 251, p-value = 1.297e-06
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.1821851 0.4071247
## sample estimates:
##       cor 
## 0.2987995

8. Is there a relationship between the number of drinks per week and the number of classes missed?

# Correlation between weekly alcohol consumption and class attendance
cor.test(study$Drinks, study$ClassesMissed)
## 
##  Pearson's product-moment correlation
## 
## data:  study$Drinks and study$ClassesMissed
## t = 1.2444, df = 251, p-value = 0.2145
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.04546504  0.19970147
## sample estimates:
##        cor 
## 0.07830198

9. Do students who report at least one all-nighter sleep less on weekdays compared to those who don’t?

# Compare weekday sleep hours based on whether the student pulled an all-nighter
t.test(WeekdaySleep ~ AllNighter, data = study)
## 
##  Welch Two Sample t-test
## 
## data:  WeekdaySleep by AllNighter
## t = 3.3663, df = 39.91, p-value = 0.001695
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  0.3298378 1.3211023
## sample estimates:
## mean in group 0 mean in group 1 
##        7.976941        7.151471

10. Do first- and second-year students sleep more on weekends than upperclassmen?

# Create grouping variable: first/second years vs. others
study$ClassYearGroup <- ifelse(study$ClassYear %in% c(1, 2), "Lower", "Upper")

# Run the t-test on weekend sleep
t.test(WeekendSleep ~ ClassYearGroup, data = study)
## 
##  Welch Two Sample t-test
## 
## data:  WeekendSleep by ClassYearGroup
## t = -0.047888, df = 237.36, p-value = 0.9618
## alternative hypothesis: true difference in means between group Lower and group Upper is not equal to 0
## 95 percent confidence interval:
##  -0.3497614  0.3331607
## sample estimates:
## mean in group Lower mean in group Upper 
##            8.213592            8.221892

Summary

This analysis explored key factors influencing sleep, mental health, and academic performance among college students. Significant differences were found across groups in GPA, early class load, stress, and sleep quality. Notable correlations emerged between sleep habits and lifestyle factors such as alcohol use and all-nighters. Overall, the findings highlight the strong connection between well-being and academic success, emphasizing the importance of healthy sleep patterns.

References

  1. https://stcloudstate.learn.minnstate.edu/d2l/lms/dropbox/user/folder_submit_files.d2l?db=14751790&grpid=0&isprv=0&bp=0&ou=6754377

  2. https://www.youtube.com/watch?v=FIrsOBy5k58