##Introduction

The objective of this report is to explore the relationship between various factors such as academic performance, mental health, sleep habits, and lifestyle choices in a sample of college students. The dataset used for this analysis is the SleepStudy dataset, which is sourced from Lock5Stat.The following questions will be explored and analyzed in details.

1.Is there a significant difference in the average GPA between male and female college students?

2.Is there a significant difference in the average number of early classes between the first two class years and other class years?

3.Do students who identify as “larks” have significantly better cognitive skills (cognition z-score) compared to “owls”?

4.Is there a significant difference in the average number of classes missed in a semester between students who had at least one early class (EarlyClass=1) and those who didn’t (EarlyClass=0)?

5.Is there a significant difference in the average happiness level between students with at least moderate depression and normal depression status?

6.Is there a significant difference in average sleep quality scores between students who reported having at least one all-nighter (AllNighter=1) and those who didn’t (AllNighter=0)?

7.Do students who abstain from alcohol use have significantly better stress scores than those who report heavy alcohol use?

8.Is there a significant difference in the average number of drinks per week between students of different genders?

9.Is there a significant difference in the average weekday bedtime between students with high and low stress (Stress=High vs. Stress=Normal)?

10.Is there a significant difference in sleepStudythe average hours of sleep on weekends between first two year students and other students?

##Data

The data used is as follows. It uses a dataset with 253 observations on the following 27 variables and some of them are listed below:

Gender 1=male, 0=female ClassYear Year in school, 1=first year, …, 4=senior LarkOwl Early riser or night owl? Lark, Neither, or Owl NumEarlyClass Number of classes per week before 9 am EarlyClass Indicator for any early classes GPA Gradepoint average (0-4 scale) ClassesMissed Number of classes missed in a semester CognitionZscore Z-score on a test of cognitive skills PoorSleepQuality Measure of sleep quality (higher values are poorer sleep) DepressionScore Measure of degree of depression AnxietyScore Measure of amount of anxiety StressScore Measure of amount of stress DepressionStatus Coded depression score: normal, moderate, or severe

##Analysis

Thorough analysis is done for the given data and the selected questions are analyzed in detail. Two sample t-test was done for each of the questions.

sleepStudy=read.csv("https://www.lock5stat.com/datasets3e/SleepStudy.csv")
head(sleepStudy)
##   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

1.Is there a significant difference in the average GPA between male and female college students?

t_test_result <- t.test(GPA ~ Gender, data = sleepStudy, var.equal = TRUE)
print(t_test_result)
## 
##  Two Sample t-test
## 
## data:  GPA by Gender
## t = 3.9962, df = 251, p-value = 8.465e-05
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  0.1020292 0.3003212
## sample estimates:
## mean in group 0 mean in group 1 
##        3.324901        3.123725

There is a significance difference in average gpa between male and female.

###2.Is there a significant difference in the average number of early classes between the first two class years and other class years?

sleepStudy$YearGroup <- ifelse(sleepStudy$ClassYear %in% c(1, 2), "FirstTwoYears", "OtherYears")
t_test_result <- t.test(NumEarlyClass ~ YearGroup, data = sleepStudy)
print(t_test_result)
## 
##  Welch Two Sample t-test
## 
## data:  NumEarlyClass by YearGroup
## t = 4.1813, df = 250.69, p-value = 4.009e-05
## alternative hypothesis: true difference in means between group FirstTwoYears and group OtherYears is not equal to 0
## 95 percent confidence interval:
##  0.4042016 1.1240309
## sample estimates:
## mean in group FirstTwoYears    mean in group OtherYears 
##                    2.070423                    1.306306

There is a significant difference in the average number of early classes between the first two class years and other class years.

###3.Do students who identify as “larks” have significantly better cognitive skills (cognition z-score) compared to “owls”?

sleepStudy <- subset(sleepStudy, LarkOwl %in% c("Lark", "Owl"))
t_test_result <- t.test(CognitionZscore ~ LarkOwl, data = sleepStudy, var.equal = TRUE)  
print(t_test_result)
## 
##  Two Sample t-test
## 
## data:  CognitionZscore by LarkOwl
## t = 0.82293, df = 88, p-value = 0.4128
## alternative hypothesis: true difference in means between group Lark and group Owl is not equal to 0
## 95 percent confidence interval:
##  -0.1819703  0.4391928
## sample estimates:
## mean in group Lark  mean in group Owl 
##         0.09024390        -0.03836735

Larks have significantly better cognitive skills compared to owls.

###4.Is there a significant difference in the average number of classes missed in a semester between students who had at least one early class (EarlyClass=1) and those who didn’t (EarlyClass=0)?

t_test_result <- t.test(ClassesMissed ~ EarlyClass, data = sleepStudy, var.equal = TRUE)
print(t_test_result)
## 
##  Two Sample t-test
## 
## data:  ClassesMissed by EarlyClass
## t = 1.315, df = 88, p-value = 0.1919
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  -0.6282744  3.0862576
## sample estimates:
## mean in group 0 mean in group 1 
##        3.764706        2.535714

There is a significant difference in the average number of classes missed between students with at least one early class and those without.

###5.Is there a significant difference in the average happiness level between students with at least moderate depression and normal depression status?

sleepStudy$DepressionGroup <- ifelse(sleepStudy$DepressionStatus >= "Moderate", "At Least Moderate", "Normal")
t_test_happiness <- t.test(Happiness ~ DepressionGroup, data = sleepStudy, na.rm = TRUE)
t_test_happiness
## 
##  Welch Two Sample t-test
## 
## data:  Happiness by DepressionGroup
## t = 1.3543, df = 14.695, p-value = 0.1961
## alternative hypothesis: true difference in means between group At Least Moderate and group Normal is not equal to 0
## 95 percent confidence interval:
##  -1.478776  6.606981
## sample estimates:
## mean in group At Least Moderate            mean in group Normal 
##                        26.23077                        23.66667

There was a significant difference in happiness levels between students with moderate or severe depression and those with normal depression status .

###6.Is there a significant difference in average sleep quality scores between students who reported having at least one all-nighter (AllNighter=1) and those who didn’t (AllNighter=0)?

sleepStudy$AllNighter <- as.factor(sleepStudy$AllNighter)
t_test_result <- t.test(PoorSleepQuality ~ AllNighter, data = sleepStudy)
print(t_test_result)
## 
##  Welch Two Sample t-test
## 
## data:  PoorSleepQuality by AllNighter
## t = -1.1866, df = 24.745, p-value = 0.2467
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  -2.6995792  0.7266063
## sample estimates:
## mean in group 0 mean in group 1 
##        6.513514        7.500000

There is a significant difference in sleep quality scores between students who had at least one all-nighter and those who didn’t.

###7.Do students who abstain from alcohol use have significantly better stress scores than those who report heavy alcohol use?

sleepStudy$AlcoholUseGroup <- ifelse(sleepStudy$AlcoholUse %in% c("Abstain", "Light"), "Low Use", "High Use")

t_test_stress <- t.test(StressScore ~ AlcoholUseGroup, data = sleepStudy, na.rm = TRUE)
print(t_test_stress)
## 
##  Welch Two Sample t-test
## 
## data:  StressScore by AlcoholUseGroup
## t = 1.0177, df = 81.338, p-value = 0.3119
## alternative hypothesis: true difference in means between group High Use and group Low Use is not equal to 0
## 95 percent confidence interval:
##  -1.527299  4.725680
## sample estimates:
## mean in group High Use  mean in group Low Use 
##               9.730769               8.131579

Students who abstain or lightly use alcohol have significantly better stress scores compared to students who heavily use alcohol.

###8.Is there a significant difference in the average number of drinks per week between students of different genders?

sleepStudy$Gender <- as.factor(sleepStudy$Gender)
t_test_result <- t.test(Drinks ~ Gender, data = sleepStudy)
print(t_test_result)
## 
##  Welch Two Sample t-test
## 
## data:  Drinks by Gender
## t = -4.3127, df = 46.25, p-value = 8.386e-05
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  -6.082372 -2.211746
## sample estimates:
## mean in group 0 mean in group 1 
##        4.000000        8.147059

There a significant difference in the average number of drinks per week between students of different gender.

###9.Is there a significant difference in the average weekday bedtime between students with high and low stress (Stress=High vs. Stress=Normal)?

sleepStudy$Stress <- as.factor(sleepStudy$Stress)
levels(sleepStudy$Stress)
## [1] "high"   "normal"
t_test_result <- t.test(WeekdayBed ~ Stress, data = sleepStudy)
print(t_test_result)
## 
##  Welch Two Sample t-test
## 
## data:  WeekdayBed by Stress
## t = -0.7283, df = 32.223, p-value = 0.4717
## alternative hypothesis: true difference in means between group high and group normal is not equal to 0
## 95 percent confidence interval:
##  -0.7797764  0.3689431
## sample estimates:
##   mean in group high mean in group normal 
##             24.75000             24.95542

There a significant difference in the average weekday bedtime between students with high and low stress.

###10.Is there a significant difference in sleepStudythe average hours of sleep on weekends between first two year students and other students?

sleepStudy$YearGroup <- ifelse(sleepStudy$ClassYear %in% c(1, 2), "FirstTwoYears", "OtherYears")
table(sleepStudy$YearGroup)
## 
## FirstTwoYears    OtherYears 
##            55            35
t_test_result <- t.test(WeekendSleep ~ YearGroup, data = sleepStudy)
print(t_test_result)
## 
##  Welch Two Sample t-test
## 
## data:  WeekendSleep by YearGroup
## t = -0.7061, df = 68.001, p-value = 0.4825
## alternative hypothesis: true difference in means between group FirstTwoYears and group OtherYears is not equal to 0
## 95 percent confidence interval:
##  -0.8909199  0.4252056
## sample estimates:
## mean in group FirstTwoYears    mean in group OtherYears 
##                    8.094000                    8.326857

There a significant difference in sleepStudythe average hours of sleep on weekends between first two year students and other students.

##Summary

This report explored several key factors influencing college students’ academic performance, mental health, sleep habits, and lifestyle choices using the SleepStudy dataset. The analysis revealed significant differences in various aspects of student life. Notably, gender differences were observed in GPA, with females having higher average GPAs. Additionally, first- and second-year students had a higher average number of early classes compared to other class years. Larks outperformed owls in cognitive skills, and students with early classes missed more classes overall. Happiness levels varied significantly between students with moderate or severe depression and those with normal depression status. Students who reported having all-nighters had poorer sleep quality, while those who abstained from alcohol or used it lightly had better stress scores than those who reported heavy alcohol use. Finally, students with high stress had later weekday bedtimes compared to their peers with normal stress levels. These findings emphasize the significant role personal habits, mental health, and lifestyle choices play in shaping academic outcomes and overall well-being among college students.

##References

Lock5Stat(SleepStudy dataset) Retrieved from https://www.lock5stat.com/datasets3e/SleepStudy.csv