Introduction

This Project will explore data pertaining to the sleep patterns among college students. The data being used will be from the lock5stat website, specifically the “Sleep Study” data set. This data set comprises of 253 observations over 27 different variables, allowing a glimpse into valuable information pertaining to the sleep habits, mental health, and lifestyle choices of college students. The following research questions will be addressed in this report:

Analyzing these questions will provide a comprehensive understanding on the behaviors and sleep patterns among college students, which can be used to develop ways to improve the overall health and academic success of students.

Data

As mentioned before, this data set comprises of 253 observations of the sleep patterns of students, with over 27 different variables that are included within. These variables vary, which include their academic performance, whether they are a early riser or stay up late, how well they sleep and for how long, and their mental status i.e. how much stress or anxiety they have. This data was obtained from a sample of students that performed a skills test to measure cognitive function, a survey that asked questions based on behaviors such as attitudes and habits, and kept a sleep diary to record time and quality of sleep over a two week period.

Analysis

Analyzing these questions should give informative insight into relationships between the various variables and behaviors. Below is the first six rows of the data set being used. to view the full data set, please use the link above.

##   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

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

##   Gender      GPA
## 1      0 3.324901
## 2      1 3.123725

There seems to be a minor difference in the average GPA between males and females, with females having a higher average GPA. The GPA range for male students is lower than that of the female students.

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

##   ClassGroup EarlyClass
## 1      Lower  0.7253521
## 2      Upper  0.5855856

The first two class years have a higher average of early classes compared to the other class years. Lower in this data table means years 1 & 2, while upper means years 3 & 4.

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

##   LarkOwl CognitionZscore
## 1    Lark      0.09024390
## 2 Neither     -0.01122699
## 3     Owl     -0.03836735

Students that are larks have a higher average score than that of owls or students that are neither. An important thing to note is that the neither/owls have a slightly negative score.

Q4: 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)?

##   EarlyClass ClassesMissed
## 1          0      2.647059
## 2          1      1.988095

Students that have no early classes have a higher rate of missing classes than that of students that had at least 1 early class. the range for no early classes missed is also bigger.

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

## 
## moderate   normal   severe 
##       34      209       10
## 
## Moderate+    Normal 
##        44       209
##   DepressionGroup Happiness
## 1       Moderate+  21.61364
## 2          Normal  27.05742

Normal students have a higher score for happiness than that of students who have moderate or higher depression levels.

Q6: 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)?

## 
##   0   1 
## 219  34
## 
##  Welch Two Sample t-test
## 
## data:  PoorSleepQuality by AllNighter
## t = -1.7068, df = 44.708, p-value = 0.09479
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  -1.9456958  0.1608449
## sample estimates:
## mean in group 0 mean in group 1 
##        6.136986        7.029412

The mean for students who pulled all-nighters is 7.029412, while those who didnt have a average of 6.136986. This means that students who pull all-nighters have a worse level of sleep quality.

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

## 
##  Abstain    Heavy    Light Moderate 
##       34       16       83      120
## $Abstain
##     mean       sd 
## 8.970588 7.581818 
## 
## $Heavy
##      mean        sd 
## 10.437500  7.797168

The average stress score of students who abstain from alcohol is lower than that of students who have heavy alcohol use. There is a high standard deviation for both which means there is a lot of variation of each group.

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

## 
##   0   1 
## 151 102
##   Gender   Drinks
## 1      0 4.238411
## 2      1 7.539216

Male students tend on average to have more drinks per week than female students.

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

## 
##   high normal 
##     56    197
##   Stress WeekdayBed
## 1   high   24.71500
## 2 normal   24.88543

Interestingly, students that have normal stress levels got to bed later than students of a high stress level, however the average between these two groups is very small (difference of about 10 minutes).

Q10: Is there a significant difference in the average hours of sleep on weekends between first two year students and other students?

##   ClassGroup WeekendSleep
## 1      Lower     8.213592
## 2      Upper     8.221892

The means are almost identical, with a difference of about 0.1 hours (10 minutes).

Summary

From these questions and the following analysis, important insights can be obtained. General consensus on the data suggests that students that have negative behaviors can have a varying impact on how well they perform in school as well as how they are mentally. Looking first at genders, female students tend to drink less and have a higher average GPA overall, while male students are the opposite. This can infer that consuming less alcohol could lead to better grades. Students who also abstain from alcohol have less stress as well, meaning that drinking less or even not at all can lead to better grades and lower stress.

When looking at students who are in their first or second year compared to students in later years, freshman and sophomores tend to have more early classes on average compared to juniors and seniors. This can be common for new students as they need to take required general courses or even courses specific to their major. Tying in to early classes, students tend to miss classes less when it comes to them being early rather than them being later in the day. When it comes to sleep, more specifically sleep on the weekend, both groups have almost identical averages in terms of how many hours of sleep that they get. This shows that students of all grades have no trouble sleeping on the weekend. This cant be said for students pulling all-nighters, as students who have reported at least 1 all-nighter have had a worse quality of sleep compared to students that have not. For bedtimes of students with high stress vs. normal stress, students that have high stress tend to on average go to bed earlier than students who have normal stress. This makes sense as it can be implied that high stress students want to get things done sooner and quicker than normal stress students, leading to a earlier bedtime. The difference isn’t great however as the averages of both are very close to each other, however the box of the high stress students is larger and lower.

Students who wake up early have a higher average Z score than students who stay up late or don’t do either, who both have slight negative scores, meaning less than average Z scores. This can infer that early risers are happier and more cognizant. This can also tie into missing less early classes as they are already up and not mentally declined. When it comes to happiness and depression, students who have moderate to severe depression are less happy compared to students who have a normal level.

All these factors and variables play off each other and can have a impact on a students well being and college career. Students need sleep, and if that isn’t adequate, they tend to be less mentally cognizant which could lead to bad grades, which then leads to stress and depression, which could lead to alcohol consumption, leading to mores stress, bad grades, worse sleep, etc. This can also be said about positive behaviors as well, such as getting up early, not drinking, going to bed at a good time, and so on. Of course social aspects could also play a role in all this as well, and could be a valuable addition to this study. All in all students need to practice good habits and seek help or guidance when things go bad. Colleges could also help play a part by conducting workshops to help students develop good habits. Data like this is important as it can help develop techniques or resources to help college students handle the stress and responsibility that can ultimatley lead to their success or failure.

References and Project Code

knitr::opts_chunk$set(echo = TRUE)
sleepstudy = read.csv("https://www.lock5stat.com/datasets3e/SleepStudy.csv")
head(sleepstudy)
boxplot(GPA ~ Gender, data = sleepstudy,
        main = " Average GPA Between Male and Female College Students",
        xlab = "Gender (0 = female, 1 = male)",
        ylab = "GPA",
        col = c("plum", "skyblue"),
        border = "gray30")
aggregate(GPA ~ Gender, data = sleepstudy, FUN = mean)

sleepstudy$ClassGroup <- ifelse(sleepstudy$ClassYear %in% c("1", "2"), "Lower", "Upper")
aggregate(EarlyClass ~ ClassGroup, data = sleepstudy, mean)
boxplot(CognitionZscore ~ LarkOwl, data = sleepstudy,
        main = "Cognition Z-Score by Chronotype",
        xlab = "Chronotype",
        ylab = "Cognition Z-Score",
        col = c("skyblue", "plum"),
        border = "gray30")
aggregate(CognitionZscore ~ LarkOwl, data = sleepstudy, mean)
boxplot(ClassesMissed ~ EarlyClass, data = sleepstudy,
        col = c("skyblue", "plum"),
        main = "Classes Missed by Early Class Status",
        ylab = "Number of Classes Missed",
        xlab = "Had Early Class (0 = No, 1 = Yes)")
aggregate(ClassesMissed ~ EarlyClass, data = sleepstudy, mean)
sleepstudy$DepressionGroup <- ifelse(sleepstudy$DepressionStatus == "moderate" | sleepstudy$DepressionStatus == "severe", "Moderate+",
                                     ifelse(sleepstudy$DepressionStatus == "normal", "Normal", NA))
table(sleepstudy$DepressionStatus)
table(sleepstudy$DepressionGroup)
aggregate(Happiness ~ DepressionGroup, data = sleepstudy, mean)
table(sleepstudy$AllNighter)
t_test_result <- t.test(PoorSleepQuality ~ AllNighter, data = sleepstudy)
t_test_result
table(sleepstudy$AlcoholUse)
subset_data <- subset(sleepstudy, AlcoholUse %in% c("Abstain", "Heavy"))
tapply(subset_data$StressScore, subset_data$AlcoholUse, function(x) c(mean = mean(x), sd = sd(x)))
boxplot(Drinks ~ Gender, data = sleepstudy,
        col = c("plum", "skyblue"),
        main = "Drinks Per Week by Gender",
        xlab = "Gender (0 = Female, 1 = Male)", 
        ylab = "Drinks Per Week")
table(sleepstudy$Gender)
aggregate(Drinks ~ Gender, data = sleepstudy, mean)
boxplot(WeekdayBed ~ Stress, data = subset_data,
        col = c("orangered3", "seagreen2"),
        main = "Weekday Bedtime by Stress Level",
        xlab = "Stress Level", ylab = "Weekday Bedtime")
table(sleepstudy$Stress)
subset_data <- subset(sleepstudy, Stress %in% c("high", "normal"))
aggregate(WeekdayBed ~ Stress, data = subset_data, mean)
sleepstudy$ClassGroup <- ifelse(sleepstudy$ClassYear %in% c("1", "2"),
                                "Lower", "Upper")
aggregate(WeekendSleep ~ ClassGroup, data = sleepstudy, mean)
t.test(WeekendSleep ~ ClassGroup, data = sleepstudy)