moon

Sleep Quality and its Related Factors

moon

Northeastern University | DS4200 Final Project | Francesca Licciardello, Janie Lu, & Jordyn Yee

Overall Introduction

Understanding sleep quality is crucial for assessing the overall health and well-being of individuals, particularly during key stages of life such as college. Sleep quality refers to how restful and restorative sleep is, going beyond just the number of hours slept to reflect how effectively the body and mind recover overnight. This metric serves as an important indicator of physical health, cognitive function, and emotional stability, all of which have significant implications for daily life.

Monitoring sleep quality provides insights into a wide range of health outcomes, from cardiovascular health and immune function to mental health and academic performance. Poor sleep quality has been linked to increased risk of chronic conditions such as heart disease, diabetes, and obesity, as well as heightened levels of anxiety and depression. Conversely, consistently good sleep quality is associated with stronger immune function, better memory consolidation, and improved mood and productivity.

Several lifestyle factors are closely related to sleep quality. Stress, caffeine consumption, physical activity levels, and study habits can all significantly influence how well a person sleeps each night. Moreover, sleep quality can vary widely across individuals depending on age, gender, location, and whether or not a person has an underlying sleep disorder, making it a multifaceted topic worth exploring in depth.

The following two references provided us insight into how stress and other lifestyle factors can influence sleep quality in undergraduate students:

  1. Effects of perceived stress on college students' sleep quality: a moderated chain mediation model
  2. Lifestyle factors associated with poor sleep quality among undergraduate dental students at a Malaysian private university

Introduction to the Data

The dataset was collected via a survey consisting of 100 responses across 14 variables. The survey was sent out to college-aged undergraduate students across many different cites, states, and countries globally. The survey was conducted using a Google Form, and responses were automatically populated to a Google Sheet, which was then exported as a .csv file. As outlined above, the attributes capture both demographic information, including age, location, sex, and area of study, as well as lifestyle factors that are commonly associated with sleep quality, such as stress level, study time, and physical activity.

Here is the survey that we sent out to collect data: Sleep Quality and Related Lifestyle Habits

Variable Name Details
Gender Participant sex
Age Participant age
Location Participants main location of residence
Major Subject that participant is studying in school
Hours of Sleep Average hours of sleep each night
Sleep Quality Self reported quality of sleep on a scale of 1-10
Physical Activity Average hours of physical activity a day
Study Time Average hours of time spent studying a day
Stress Level Self reported stress level on a scale of 1-10
Heart Rate Average heart rate in beats per minute
Sleep Disorders If participant has a sleep disorder or not
Disorder Name Name of participants sleep disorder if applicable
Caffeine Average mg of caffeine consumed in a day

Sleep Quality Data Analysis

Geographically

The interactive map below visualizes average sleep quality and study time across different regions. The dropdown menu can be used to switch between either a worldwide or a U.S.-focused view. For either mode, you can hover over the map to display sleep quality, sleep duration, and study time for any location where data was collected from.

Average Sleep Quality Across the Globe

What Our Data Reveals at a Global Level

Globally by Country

This visualization presents average sleep quality and study time across a selection of countries and U.S. states. At the global level, the data compares how students in different countries balance sleep and academic effort. From all of our collected data, the average sleep quality on the scale of 1-10 is 6.80, the average study hours is 4.53 hrs/day. Some interesting findings revealed from the world map are : even though Canada displays the shortest average study hours (2), it also have the lowest average sleeping quality of 4. On the other hand, countries like China and Switerland show a significantly higher average study hours (7hrs & 13 hrs) while maintaining a high sleep quality (8 & 9). This was a surprising finding, as our initial hypothesis expected that higher study hours would correlate with lower sleep quality, but the data that we collected does not support this assumption. Compared to the average, UK seem to have a slightly higher sleep quality and less sleeping hour which may suggest a balanced lifestyle. Overall, the global data suggests that there is no clear inverse relationship between study hours and sleep quality, and that other factors may be influencing these outcomes in different countries.

By State in the U.S.

For US data, the map provides a more detailed breakdown by state, showing average sleep quality, sleep duration, and study hours. The data of US students are Average Sleep Hours: 7.26, Average Study Hours: 4.48, and Average Sleep Quality: 6.73 The results of our map highlight noticeable variation across states. For instance, Minnesota shows both high sleep quality and high study hours, while states like Illinois and New York have comparatively lower sleep quality (5.5 & 6.21) despite moderate to high study time. When it gets to States in the southeast side of US, they generally have higher sleep quality and less study hours which may suggest a more relaxed lifestyle. On the other hand, states in the northeast side of US generally have higher study hours and lower sleep quality which may suggest a more stressful lifestyle.

Sleep Quality by Factor

Hours of Sleep vs Sleep Quality

Heatmap: Hours of Sleep vs Sleep Quality The second visualization we will explore is a heatmap displaying the relationship between hours of sleep and self-reported sleep quality among participants in our dataset. Each cell represents the number of participants who reported a given combination of sleep hours and sleep quality, with darker teal indicating a higher concentration of participants. The chart reveals that the majority of participants in our dataset fall within the 6 to 8 hour range of sleep, with sleep quality ratings generally between 6 and 9. Notably, the relationship between hours of sleep and sleep quality does not appear to be strictly linear. Rather, it may follow a slight quadratic pattern, in which 6 to 8 hours of sleep represents an optimal range, with both lower and higher sleep durations associated with comparatively lower quality ratings. This suggests that sleeping too little or too much may each have a negative effect on self-reported sleep quality.

Study Time and Hours of Sleep by Major

Scatter Plot: Study Time vs Hours of Sleep by Major The next visualization we created is an interactive scatter plot that displays the relationship between study time and average hours of sleep per night. The scatter plot is color-coded by area of study, as we categorized self-reported majors into various broader categories. The dropdown menu allows users to select a particular area of study, and there is also a tooltip upon hovering over a point that displays sleep quality and exact major. Based on this diagram, major category does not appear to be a strong predictor of either sleep or study habits, suggesting that other factors may be more influential. There is also no strong trend between hours of sleep and hours spent studying. The majority of points fall within a similar range, clustering between 6-8 hours of sleep and 2-8 hours of study time. While one might expect that a higher study time correlates with lower sleep time, the data does not support this. This suggests that sleep habits among students may be driven by more individual lifestyle factors than academic workload.

Hours of Studying, Physical Activity, Sleep, and Screen Time by Sex

Stacked Bar Chart: Time Allocation by Sex The next figure is a stacked barplot that displays hours of sleep, study time, physical activity, and screen time by sex. This was created using D3. Overall, male participants average slightly more total hours across all categories than female participants, with males at approximately 23 hours compared to females at roughly 21 hours. The most meaningful takeaway from the figure is the difference between male and female students in screen time, with males averaging approximately 8 hours compared to females at roughly 6 hours. The other factors of sleep, physical activity, and study time appear to be relatively similar between the two groups, making screen time stand out as the primary distinguishing factor. Resultedly, screen time may be worth exploring further as a potential factor impacting sleep quality, given how much it dominates the male bar in particular.

Lifestyle Factors Distributions

Histograms: Distribution of Key Lifestyle Variables The four histograms visualize the distributions of key variables in the dataset: daily screen time (in hours), sleep quality (rated from 1 to 10), daily caffeine consumption (in mg), and resting heart rate (in BPM). Screen time shows a right-skewed distribution, with most values concentrated between about 4 and 10 hours and a few high outliers exceeding 15 hours. Sleep quality appears roughly symmetric and centered around a mean of approximately 6 to 8, indicating that most participants report average to good sleep. Caffeine consumption is highly right-skewed, with a low median but several extreme outliers reaching above 200–300 mg, suggesting that while most individuals consume little caffeine, a small group consumes significantly more. Resting heart rate is more normally distributed, clustering around a mean of 60–80 BPM with relatively few extreme values. An outlier that clearly does not make sense in our data is that there is a data where the screen time is literally 24 hrs, which must have been a data entry error. Another outlier that clearly does not make sense is that there is a data where the resting heart rate is extremely low. An interesting finding is that while sleep quality is fairly concentrated around similar values for most individuals, behaviors like screen time and caffeine consumption vary much more widely. This indicates that people tend to have similar sleep outcomes despite differences in their daily habits, which raises questions about what factors actually drive changes in sleep quality and connects to our research on understanding these influences.

Sleep Quality vs Stress

Histograms: Screen Time, Sleep Quality, Caffeine, and Heart Rate

Scatterplot: Sleep Quality vs Stress This final graph is a regression analysis explores the correlation between student’s stress level and their sleep quality. By plotting a scatter plot, the visualization reveals a negative linear trend. The red regression line, supported by a shaded 95% confidence interval, seems to indicate that as sleep quality improves, reported stress levels declines. The distribution of data points suggests that while outliers exist, there is a negative correlation between stress level and sleep quality.

Summary and Additional Work

Looking across all of our visualizations, the main takeaway is that sleep quality among college students does not appear to be driven by any single factor. Study time, major category, and even total hours of sleep do not show a consistent or strong relationship with how well students report sleeping. Instead, the data suggests that sleep quality is shaped by a combination of lifestyle behaviors that vary widely across individuals. Screen time in particular stood out as a notable differentiator, especially between male and female participants, and may be worth investigating further as a potential influence on sleep quality.

This pattern holds even when looking at the data geographically. Across both countries and U.S. states, sleep and study time are not always in conflict, with some regions showing students who are able to study more while still maintaining good sleep quality, suggesting that factors like time management and lifestyle play an important role. This challenges the idea that studying more always means sleeping less. At the same time, differences across countries and states show that this balance is not consistent everywhere, with some places showing higher study time associated with lower sleep quality, while in others the two seem to coexist. Taken together, the global and lifestyle data both point to the same conclusion: sleep quality is a multifaceted outcome influenced not just by time spent studying, but also by environment, culture, and daily routines.

If we were to continue this research, a larger and more diverse dataset would allow for stronger conclusions. A lot of our current dataset was collected from students living in Boston, and other locations on our map had fewer participants. If we could increase our data, we might start to see stronger trends related to different places, majors, or factors that we're not quite able to see now.