Steps and Sleep
Introduction
I have intermittently used a FitBit wearable device over the past five years. I purchased my first one because, spend a large portion of my days sitting in front of screens and devices, and needed a physical reminder to occasionally take breaks and get up and move. While I could just set a timer on my phone to accomplish this task, when a phone timer goes off, the noise can be disruptive and intrusive. However, a wearable device affords the benefits of being a watch and this "move-it" timer I need all in one.
Currently, I use the Charge 3 device, which functions as a watch that monitors my steps, distance, heart rate, and sleep. As I frequently forget to synchronize my device with the FitBit app, and have no particular interest in examining my history of steps, I would not say I as a member of the "Quantified Self" (QS) movement. Yet, as the data is there, this exercise presented an opportunity to learn new skills of data acquisition, cleaning, and manipulation.
Exercise and sleep (approximately 8 hours per night for an adult) are known contributing factors to improving the quality life of the human adult (Piwek et al., 2016). Qualitative and quantitative studies are present in academic literature which support the benefits of sleep and exercise, and which outline the effects of sleep deprivation and lack of exercise on the human body. While this study alone cannot prove the causality of this relationship, it aims to provide a personal introspection into the topic. In particular, I was curious to see if an increase over FitBit's recommended 10,000 steps per day day would have an effect on the duration and quality of sleep I had for a three week time period.
Methodology
To create my personalized dataset, I began by extracting my data via the FitBit API. After following the directions on FitBit's developer website, I obtained all my data for the past five years as 2,359 JSON files. With the assistance of a school colleague's python script, I extracted all the sensitive and personal data from these JSON files that I did not wish to share. I elected to use only the 144 JSON files which contained information on my steps, distance traveled, and sleep.
Next, I began the process of reviewing these JSON files in OpenRefine where I converted select information into comma-separated values files (CSV). While attempting to batch process these 144 files, I realized after three hours of running that it would take too long to clean the data for this assignment in OpenRefine. Instead, I decided to narrow the size of my dataset to the past three weeks. As a result, I was able to obtain three CSV files that contained data logs on time, sleep, distance traveled, and steps taken only. Additionally, in OpenRefine I created several additional columns, which calculated time in minutes and miles based off of the steps. As I have previously had my walking gait analyzed, I knew that for every 1000 steps I take, I travel approximately 0.52 miles. This information was used to calculate what my miles were.
These files were then imported into Tableau Desktop, where the steps and distance datasets were joined and analyzed. While the sleep data was also imported into Tableau, joining this data with either of the other two datasets produced a fatal error, which repeatedly crashed my computer and the laboratory computers at Pratt Institute. While I wait to hear back from Tableau's help services regarding this, the sleep data was analyzed separately.
Observations
As I averaged 12,488 steps per day over this three week period, by FitBit's standards, I am an above average stepper! When I looked back at the dates (February 3rd, 5th, and 23rd) where my steps were lower than 10,000, I noticed that these dates coincided with cold and wet weather conditions. Similarly, by clustering the quality of my sleep, what I found revealing is that I am a fairly light sleeper. While I cannot say for certain that this is normal for me, as the time period for this study coincided with the 2nd-5th weeks of this semester, it is possible that I am a light sleeper because with four classes and a part-time job, I am always working. This time period could also explain why the average amount of sleep I received during this period is only 6.3 hours per night.
Furthermore, while I cannot say with certainty that my increased daily walking affected my sleep, this study does suggest that this is a possibility for a more in depth study. On February 1st, 2nd, and 15th, my step-count was over 10,000 and I had 10, 9, 9.25 hours of sleep, respectively. I do know for certain that on each of these days I also went to 90-minute yoga classes, which would suggest the possibility of correlation between increased physical activity and sleep. However, on February 21st, the day of my maximum step-count for this period (18,891), I did not go to yoga yet I achieved 9 hours of sleep, and had a Deep Sleep period of 124 minutes, which was more than the days I went to yoga. Again, this could be suggestive of a relationship between increased physical activity and quality sleep, but further testing and analysis would be required.
1. Piwek, L., Ellis, D. A., Andrews, S., & Joinson, A. (2016). The Rise of Consumer Health Wearables: Promises and Barriers. PLoS Medicine, 13(2). https://doi.org/10.1371/journal.pmed.1001953