Visualising two years of sleep-data, proving and (mostly) disproving my own sleep related theories
I can never overstate how much I love sleep. I obsessively think about whatever influences it, and how do I perfect it. This motivated me to pull all the sleep data that was available from my fitness tracker for the last 2 years, and dig through it to find some clues.
Observing overall sleep patterns
The first thing I did was to make a visual with EVERYTHING in it, so I could look for some meta patterns. A special feature of this analysis is the correlation with my monthly subscription to female biology - periods - endearingly referred to as Irma henceforth. I was convinced that the physical and emotional distress during that time of the month has a substantial negative effect on my sleep quality. Though I could only show one year at a time with this first chart, its a full cycle of all seasons and a decent starting point.
• Each cell on the grid represents one night of the year.
• The colour of each cell is that night's sleep quality score: the bluer the better, the oranger the poorer.
• The 12 months are angular slices and the concentric rings show the 7 days of the week.
• The bright dots in each cell represent the phases of Irma
A pie chart breaking down the proportion of sleep quality across the entire dataset.
One of the theories I had before the analysis was that I have almost as many poor scores as I have good. I was pleasantly surprised to see the low share of poor, and the remarkably high share of good scores. However, the latter mostly ranges just between "Fair" (70s) and "Good" (80s). I kind of knew this which the data now confirmed.
One night with a score 96 - highest in the entire dataset of ~700 nights. That was in Dec-2023, more than 2 years ago.
11 nights were above 90, and only 3 without counting 90.
Candlestick chart showing the bed time and waking time pattern.
I want a realistic score goal (not 90+, sigh!) that is closest to what feels like good sleep to me. So I probed the more repeateable 85+ scoring nights for bed/wake times and compared them with nights of score under 40.
The high scores have roughly consistent bedtimes of around 11-12 pm and wake time of 8-9 am.
Most low scores nights had erratic timings and durations, of course. I can identify many of those were dates when I was travelling.
I’m not sure if that’s just my body clock driving the good scores, or Garmin's general standards of sleep/wake times. But it's a good lead to explore more.
How days of the week shape sleep
My hypothesis before I started the visualisations was that weekends have better sleep because there’s no work stress and plenty of time to sleep in etc. Then I saw the ‘everything’ chart (the circular calendar grid) above, the outer rings seemed to have more orange in them. So I unfurled the rings into bar and line charts and plotted the scores split through each day of the week.
Bar chart comparing sleep quality for each day of the week.
Weekdays are clearly doing better than the weekends. It becomes more obvisous when you flatten the bars to quality intervals. And on second thoughts, weekends are not surprising because there is indulgent dining, physical tiredness, and late bed times. Also, many travel days coincide with the weekends more than the weekdays.
9 of the 11 nights with 90+ scores are weeknights.
Monday and Tuesday have highest, and Saturday has the lowest share of 80+ scores among all days.
Note to self - Investigate the extra orange on Tuesday. Maybe its mid-week work fatigue during some specific weeks.
- Trend lines comparing the mean sleep stages - Deep, Light, REM and Total for each day of the week.
- Top line covers the mean sleep score of each day of the week
Deep and REM are roughly consistent at ~1 and ~2 hours, but still marginally better mid-week.
Monday has the highest mean score but lowest mean deep+REM sleep hours.
Garmin says deep sleep is important for physical recovery, whereas REM is good for improving memory function.
I don't mind the extraordinarily long REM. I love that rush of visiting another world, even though I forget the actual dreams soon after waking up.
But I think it cuts into my deep-sleep. Increasing physical activities/workout could pull in some more deep, and get me that 100 I dream about.
How months and seasons influence rest
So far my undisputed theory was that I sleep better in spring, summer, and autumn compared to winter. My preferred sleep temperature is when it is cool and breezy, enough to pull up a thin blanket but keep one foot out of the blanket.
Bar chart comparing quality across all months
*Feb and March have many missing days in the dataset, so these 2 bars might be skewed.
Well, hypothesis only partly confirmed about warmer months winning on quality. Besides optimal temperature, there's also higher amount of outdoors physical activity that likely contributes to better sleep quality in warmer months.
May to August have ~40% of all good sleep (80+ score), and only ~11% of all poor sleep (score under 40).
However, winter is a close second to summer, which I had not expected! The blue curves peak in summers, drop in the transitional months of spring an autumn, but rise again in coldest winter months. Likely because these are months of low work activity with all the western 'happy holidays' and well regulated indoor temperatures.
- Trend lines comparing the mean sleep stages - Deep, Light, REM and Total for each month.
- Top line covers the mean sleep score of each month.
Here's another quirky seasonal insight - the quality-score trend is almost an inverse of the sleep-duration trend. Even though there are more hours of sleep during the colder months, the score is still better in warmer ones.
July has the highest mean score, and the highest mean durations of deep and REM.
December has the highest mean total sleep duration, but has the second lowest mean score.
It should be noted that this total sleep duration is the total time spent in bed, including the restless awake moments. This would explain the poor quality of these long-sleep-low-score nights.
The cycles of sleep through cycles of biology
The pièce de résistance of this whole study - how has my menstrual cycle been affecting my sleep. I made another chart similar to the first circular calendar, but this time with more focus on comparing the cycle nights with bar sizes instead of just the colour gradients.
The red bloody Irma days are dated accurately, naturally.
The others dates are approximations:
• PMS is ~10 days before the day Irma arrived
• Eggy as ~14 days before the day Irma arrived
• The rest are Free.
The red nights actually have long bars! This goes contrary to my hypothesis.
Even on the the first 3 Irma nights, the bars are mostly long despite max discomfort of intermittent cramps and getting up multiple times to change.
But the hormones must be doing something. And they are, on the other nights leading up to the actual Irma arrival.
The white (”Eggy” aka ovulating days) and yellow (PMS) have more number of short bars compared to other nights.
Bar chart comparing quality intervals across the 4 Irma phases
Only 2 of all 40 poor nights (score under 40) was an Irma night, whereas 27 were on a PMS or Eggy night.
8 of the 11 best (90+ score) nights were on a Free night.
PMS has the most count of poor nights followed by Eggy, although the boundary between these two is at best a guess. Collectively, they claim the majority of the poor sleep nights.
And with that we can now say for certain that Irma is released of all charges.
Sorry Irma!
Summarising what I learnt,
• There are far more good days than bad
• Consistent bed-time and waking-time improve sleep
• Weekdays are better than weekends; Summers are better than winters
• Increased outdoor physical activities improve sleep
• PMS has way more latent negative effect compared to actual period days
Of course, all of this analysis is speculative and there are so many variables in this equation that it cannot give a black and white to-do list.
What it has given me is some debunked theories about my sleep that I was totally convinced with, and an endless curiosity to find out more variables and debunk (or hopefully bunk) more of my theories.