University is an experience that goes differently for each individual. There are those individuals that spend most of their time studying for exams, while others use that allotted time for various forms of recreation. The one thing that remains constant, and should remain constant is the fact that every student needs their slumber. This study aims to plot the correlations between personal demographics and hours of sleep.
Up to 60% of all college students suffer from a poor sleep quality, and 7.7% meet all criteria of an insomnia disorders. Sleep problems have a great impact on the students’ daily life, for example, the grade point average. Poor sleep has also been linked to mental health problems such as depression and anxiety.Sleep Problems in University Students
Good sleep is strongly linked to learning, memory, creativity, and problem solving. However, poor sleep habits notoriously plague college and university students, depriving them of performing their best when it matters the most.How University Students Sleep
It’s not far-fetched to assume that most people have experienced a “zombie-like” feeling when they do not get enough sleep. It’s not hard to say that there are people who feel worse throughout the day if they did not catch enough “z’s” the night before. It’s pertinent knowledge that sleep is essential and there are numerous studies highlighting the pros and cons of sleep and lack thereof.
This study, however, is for the university students. As stated earlier, lack of sleep can have a detrimental effect on one’s marks and mental health. And in a pressuring environment such as university, it only makes the problem that much worse. If trends show that students in certain faculties are receiving less sleep, then perhaps students and staff can work together to reduce the study load and ensure the mental wellbeing of those studying is kept in tact.
library(data.table) # for importing dataset
library(corrplot) # correlation analysis
library(tidyverse) # data handling
library(GGally) # better data visialization
library(plotly) # interctive data visualization
library(DT) # datatable
library(stringr) # data cleaning
sleepstudy <- fread("SleepStudyCleaned.csv", data.table = F, stringsAsFactors = TRUE)
names(sleepstudy) <- c("Date", "Gender", "Age", "Nationality", "Degree", "Double_Degree",
"credits_of_semester", "hours_in_class_per_week", "hours_studying_per_day",
"hours_sleeping_per_night")
sleepstudy$Date <- as.character(sleepstudy$Date)
sleepstudy$Date <- sleepstudy$Date %>% str_replace(pattern = "午後", replacement = "PM")
sleepstudy$Date <- sleepstudy$Date %>% str_replace(pattern = "午前", replacement = "AM")
sleepstudy$Date <- as.factor(sleepstudy$Date)sleepstudy %>%
datatable(option =
list(lengthMenu = c(5, 10, 48),
pageLength = 20))This table is the summary of the data gathered, which shows the information and can be arranged in ascending or descending order.
## 'data.frame': 48 obs. of 10 variables:
## $ Date : Factor w/ 48 levels "2018/04/23 1:55:39 PM GMT+10",..: 1 2 3 5 6 7 8 9 10 11 ...
## $ Gender : Factor w/ 2 levels "Female","Male": 1 1 1 1 1 2 2 1 2 2 ...
## $ Age : int 35 18 18 19 22 21 23 28 21 23 ...
## $ Nationality : Factor w/ 16 levels "Afghan","Australian",..: 2 2 3 1 16 8 9 2 2 2 ...
## $ Degree : Factor w/ 22 levels "Advance Computing & Science",..: 9 9 9 17 19 7 17 17 4 5 ...
## $ Double_Degree : Factor w/ 2 levels "No","Yes": 1 1 1 1 2 1 1 1 1 1 ...
## $ credits_of_semester : int 18 24 24 24 24 24 12 18 24 24 ...
## $ hours_in_class_per_week : int 13 5 17 20 18 10 8 15 6 12 ...
## $ hours_studying_per_day : num 2.5 9 2 3 6 5 1 3 5 3 ...
## $ hours_sleeping_per_night: num 7 7 6 6 6 6 8 8 8 7 ...
This list shows the structure of the dataset, showing the number of rows and columns and class of each variables.
sleepstudy %>% ggplot(aes(x = hours_sleeping_per_night)) +
geom_histogram(aes(fill = Gender), binwidth = 1.0) +
geom_vline(xintercept = mean(sleepstudy$hours_sleeping_per_night), linetype="dotted",
color = "blue", size=1.5) +
geom_text(aes(x=mean(sleepstudy$hours_sleeping_per_night), label="Average Sleep Hour", y=10),
colour="blue", angle=90, vjust = -1, text=element_text(size=11)) +
geom_vline(xintercept = 8, linetype="dotted",
color = "red", size=1.5) +
geom_text(aes(x=8, label="Recommended Sleep Hour", y=13),
colour="red", angle=90, vjust = -1, text=element_text(size=11)) +
labs(x = "Sleeping Hour", title = "Sleeping Hour") +
scale_fill_manual(values = c("pink", "skyblue"))According to National Institute of Neurogical Disorders and Stroke, most adults need 8 hours of sleep a night. Reading the study, it becomes clear that the body’s anatomy was designed to function with sleep as the basis of recharging energy for the next day. By limiting these numbers, you’re depriving your body of the different (1, 2, 3 and REM) cycles of sleep needed, which throws it off its circadian rhythm.
While it is true that as one grows older, less sleep is needed as the human body slows down its development, it is still needed for daily processes which arguably become more tiring as we age. Which lead to poor performance in the long run due to a combination of poor memory and motor skills.
According to the data, women on average sleep less, and the mode of the data set for females is six hours as compared to the seven hours of sleep that men get. This could be accounted to issues such as insomnia caused by the greater amount of hormones that women have.
This is contrary to the study mentioned before as it stated that women sleep more than men. However they also included military schools where men are required to sleep less hours in order to do more training; this may account for the discrepancy in results.
corrplot_df <- sleepstudy %>%
select(hours_sleeping_per_night,Age, credits_of_semester,
hours_in_class_per_week, hours_studying_per_day)
corrplot_df <- corrplot_df %>%
mutate(hours_in_class_per_day = hours_in_class_per_week/5)
corrplot_df <- corrplot_df %>% select(-hours_in_class_per_week)
names(corrplot_df) <- c("Sleeping Hour per night", "Age","Credits for semester", "Studying Hour per day", "Hours in class per day")
corrplot(cor(corrplot_df),
method="color",
sig.level = 0.01, insig = "blank",
addCoef.col = "black",
tl.srt=45,
type="upper"
)This correlation graph shows the relative relationship between two different factors. While it may not seem conclusive as the values are approaching zero, it tells a lot due to the positive and negative correlation. Each have their own reasoning behind it, but a good example would be how age and studying hours have a positive causal, possibly due to more course-load as the years go on. Or how there is a weak negative correlation between age and credit Points being done for the semester, as well as a weak negative correlation between hours at university and hours spent studying at home (potentially meaning that if students are spending less time at uni, they’re spending more time at home catching up).
average_sleepstudy <- sleepstudy %>%
group_by(Degree) %>%
mutate(average_hours_in_class_per_day = mean(hours_in_class_per_week)/5,
average_hours_studying_per_day = mean(hours_studying_per_day),
average_hours_sleeping_per_night = mean(hours_sleeping_per_night)) %>%
select(Date, Gender, Nationality, Degree,contains("average"))barplot <- average_sleepstudy %>%
distinct(Degree, .keep_all = T) %>%
gather("average_hours_sleeping_per_night",
"average_hours_in_class_per_day", "average_hours_studying_per_day",
key = "Type", value = "Time") %>%
ggplot(aes(x = Degree, y = Time, fill = Type)) +
geom_bar(stat="identity",
position=position_dodge2()) +
scale_fill_discrete(
labels=c("Class Hour per Day",
"Sleeping Hour per Day",
"Studying Hour per Day")) +
theme(axis.text.x = element_text(angle = 20, hjust = 1)) +
labs(title = "Average Sleeping, Class and Studying Hour")
ggplotly(barplot) %>%
layout(legend = list(orientation = 'h', y =-1))The data shows how that out of all the degrees that answered the survey, only three of them got more than or equal to the recommended eight hours of sleep. Oddly enough, they do not belong to the same faculty. This is when the data becomes more representative of the student population than the degrees. The hours tend to be within the same boundaries for sleep however, being within the five hour mark as the minimum. Other than that, there seems to be no actual correlation between the three variables.
sleepstudy %>%
ggplot(aes(x = Nationality, y = hours_studying_per_day, fill = Nationality)) +
geom_boxplot(show.legend = FALSE) +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
labs(y = "Hour", title = "Studying Hour / Nationality")The group wanted to ascertain if there was any relation at all between nationality and studiousness. Currently there are no studies about this, but going off on our own tangent here, the group decided that it would be an interesting idea to see if there was a link due to culture or other possible factors. One problem was that we were not able to get a full picture, due to a heavy amount of respondents being skewed to particular nationalities, but we were able to make a box plot of the data.
To conclude, in our research we have found the following things:
Overall, the majority of students in university are not getting the recommended hours of sleep, which is detrimental to their health and performance. This needs to be changed and awareness of this issue needs to be raised. Students should consult counselors about lack of sleep if it ever becomes a problem.