Rethinking: Sleep Part II (Crunching the Numbers)

Word Count: 1300    |   Time to Read: 8 minutes

This is a part of Rethinking, an ongoing series of posts focused on changing perceptions and promoting more advantageous behavior.

When I wrote Rethinking: Sleep after the first semester of my freshman year of college, I thought I had the esoteric world of slumber all figured out. Not only had I disproved the efficacy of polyphasic sleep and explored the dangers of sleep deprivation, I came to the conclusion that my body wasn’t built for any less than 6.5 hours of sleep.

TL;DR- polyphasic sleep works for individuals with rigid, fixed schedules; if you like variety, you’re SOL.

While this post won’t be as comprehensive as my last, it will focus on several trends I’ve gleaned from analyzing my own sleeping behavior and how I am better able to obtain an optimal amount of rest while juggling far too many responsibilities.

I’m a big believer in the Quantified Self (QS) movement. Although I don’t go so far as to track every calorie I consume or how many minutes I spend working productively, I do enjoy monitoring my fitness trends as well as my sleeping patterns. With the right amount of scrutinization, such data can guide one towards periods of peak performance and greatly increase quality of life.

At the time of this post, I have logged my sleep over the last 1300 nights of my life and I have no intention of stopping.

But simply keeping track of this data isn’t enough. For instance, I used to save my daily to-do lists in a folder on my computer. Every once in a while I would look at certain dates, such as my birthday or July 4th, and see what kinds of tasks I outlined for myself. Otherwise, the files just sat there gathering digital dust.

In the process, I committed two QS cardinal sins: 1) I mindlessly collected data without any intention of analyzing it and 2), which is far worse, the data weren’t formatted in such a way that would allow for analyzation.

As I touched on in Part I of Rethinking: Sleep, the format of my sleep log allows for easy importing into statistical software, such as STATA. Running regressions allows me to make use of all those observations and determine under what conditions I obtain the optimal amount of rest.

My sleep log is formatted as such,

Photo 1

While the dates and times I slept are nice additions, the most important data points come with the difficulty I had falling asleep, the hours I slept in total, the quality of sleep, and the amount of time I slept in.

Note that most of these metrics are entirely subjective. Because I don’t use any sort of sleep monitoring equipment, such as a FitBit, the true amount of sleep I receive each night is imprecisely based on the time I went to bed and the time I woke up.

To make data analysis easier, I rank my difficulty in falling asleep and my quality of sleep on a 1-3 scale, 1 being the worst (took 15+ minutes to fall asleep; slept horribly) and 3 being the best (took <5 minutes to fall asleep; slept like a baby).

In the past I’ve toyed with keeping a sleep journal where I explored why I had difficulty falling asleep— anxiousness over an exam, excitement for an event, etc.— but it’s too time-consuming for me. Recording my sleep data only takes me about a minute each morning and with time, it’s become a central habit of mine.

At different points in the last three years I also kept a log of my dreams, though I’ve found that this must be done directly after one wakes up or they’re likely forgotten. Because I prefer to exercise in the morning before doing any writing (for instance, I got the idea for this post during a half-hour run), writing down my dreams just isn’t for me.

My Hypotheses

I plan to run three regressions assessing the relationships between,

– My difficulty falling asleep and the quality of my sleep, wherein difficulty is the independent variable (IV) and sleep quality is the dependent variable (DV)

– Whether or not I slept in and my difficulty falling asleep (sleeping in = IV; difficulty = DV)

– Whether or not I read before bed and my difficulty falling asleep (reading = IV: difficulty = DV)

I expect that 1) when it’s easier for me to fall asleep, I enjoy higher quality sleep; 2) sleeping in adversely affects how long it takes me to get to bed the following night; and 3) reading before bed makes falling asleep easier.

Initial Results

Result #1: Easier to fall asleep = more restful night

Running a regression in STATA using about 880 observations, I determined that the difficulty I had in falling asleep had a statistically significant relationship (if you’re wondering what this means, I give a brief synopsis of confidence intervals in the methodology section) with the quality of sleep I experienced. That is to say, when I was able to fall asleep faster, the better quality sleep I received and the more rested I felt the next morning.

Photo 2

Given that the conditions were kept constant in about 90-95% of these entires (I slept in the same place each night), any sort of situational change was not deemed a contributing factor. For example, if I were traveling frequently and often encountered uncomfortable hotel beds, it is more likely that I would have a hard time falling asleep and then go on to have a terrible experience sleeping, an observation that would also elicit these results.

One less than encouraging result in the R-squared value, found in the column on the right side of the graphic. This figure, which ranges from 0 to 1, represents how well the set of data fit one another.

If one were trying to assess the connection between the U.S. stock market and national GDP— how they might rise and fall in unison— such a value might be of interest. Here, the match between the data points isn’t as important as their correlation.

Result #2: There is only a small relationship between sleeping in and the difficulty falling asleep the following night

Regressing roughly 200 entries (I only started tracking whether or not I slept in within the past year) on STATA returned insignificant results in analyzing whether sleeping in would positively or negatively affect the ease at which I fell asleep. In fact, the somewhat large p-value of .454 suggests that there exists little relationship.

(I had to adjust the ‘Slept-In’ data for it to have statistical meaning in STATA. Again, check out my methodology below.)

Photo 3

What ultimately might better determine the ease at which I fall asleep is the timing of my rest the previous night. If were to sleep from 2 am to 10 am and then attempt to fall asleep at 11 pm that night, I would no doubt find it hard to get some shut-eye. My body, after all, has briefly grown accustomed to going to bed at 2 am. It simply isn’t tired enough for sleep at 11 pm.

Moreover, the sheer amount of rest I receive the night previous also plays a role. If I only sleep from 2 am to 6 am and then head to bed at 10 pm that night, I am surely going to fall asleep more easily. My body is running on an inadequate amount of rest and will succumb to sleep the moment it receives the chance.

Result #3: Reading before bed eases the process of falling asleep

Finally, I regressed those same 200 observations to determine if the read variable (whether or not I had read the night before) was related to the ‘difficulty’ variable. To my surprise, I received significant results (p=.008) with a negative coefficient, which means that reading before bed (a ‘1’) was related to an easy night getting to sleep (a ‘0’). If I read before bed, the less difficulty I’ll experience in falling asleep.

Photo 4

One of the most important habits that’s unfortunately outside of the realm of statistical analysis (or, would require a great deal of data manipulation, some of which might be over my head) is my consistency in going to bed and waking up at roughly the same times every day. In fact, such uniformity is listed by the Centers for Disease Control (CDC) as its number one recommendation for improving sleep quality. (See the full list here.)

As I mentioned in my last piece on sleeping, my optimal amount of rest is somewhere in between 6.5 and 7.5 hours. In simply scrolling through my sleep data, I see that I experience the lowest difficulty falling asleep and the highest quality of sleep when I am within that range.

Keep in mind, of course, that everyone’s physiology and psychology is different. I have friends who require upwards of nine hours each night and others, namely my academic advisor, who get by with five or six hours. There are several ‘gods among men’ who seemingly get by with just four hours a night, such as Margaret Thatcher and Donald Trump, though not without some deep-seated genetic cause.

In 2014, researchers at the American Academy for Sleep Medicine released a study exploring a mutation of the BHLHE41 gene and short sleep duration. Among 100 twins pairs, those with a specific variant of the gene were shown to sleep more than an hour less than their counterpart: five hours compared to just over six hours. Further, when deprived of sleep for almost two days, the twin with the mutation experienced fewer lapses in cognitive performance and needed less recovery sleep compared to the other twin (American Academy of Sleep Medicine).

All in all, whether you start tracking the amount of rest you receive each night or simply begin implementing new sleep strategies, such as reading fiction before bed or meditating, I hope that you’ll see sleep not as an evolutionary obligation which should be avoided whenever possible but instead as a respite from a sometimes dismal world.

“There is a time for many words and there is also a time for sleep.”

Homer, the Odyssey


I ran three simple linear regressions in Stata version 13.0. To make the sleep data easier to read, I converted most of the variables, specifically those for sleeping-in and the difficulty falling asleep, to ‘dummy variables’.

It’s an uncomplicated, albeit somewhat imprecise, way of assessing the presence or absence of a condition within a study. If I slept-in on a given morning, that observation would receive a ‘1’, a positive value. Meanwhile, if I woke up on time, a ‘0’ would take its place, representing an absence of sleeping in. The same goes for difficulty- if I experienced little difficulty falling asleep (a rating of ‘2’ or ‘3’), the observation would be reassigned as a ‘0’; a ‘1’, which denotes difficulty, would from rating my night a ‘1’.

In order to properly assess the interaction between sleeping-in and the difficulty falling asleep, I lagged the sleep-in variable by one day so that it aligned with the observations for difficulty. Without this lag, the set of observations for sleeping-in would’ve been ascribed to the incorrect night and the results, whether significant or otherwise, would’ve been misleading.

Finally, a primer on confidence intervals.

The p-value of a statistical test denotes the level of significance between observations. In other words, it’s a test of the validity of a claim. Depending on the study, the threshold for significance is a p-value of either .05 or .01. (In the regressions above, my significance benchmark was a p-value at .05 or less.)

These values refer to a confidence interval of 95% and 99%, respectively. A confidence interval is a parameter that assesses how sure one is that the data observed match the claim, called the alternative hypothesis. If the p-value is sufficiently low enough, it provides evidence for one to reject the null hypothesis, which states that the claim is untrue, and declare the results statistically significant.

For example, in my third regression I obtained a p-value of .008. With 99.992% confidence, I can reject the null hypothesis that reading before bed and the ease at which I fall asleep don’t have a relationship

Sleep tight!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.