(Updated 2nd August 2013.)
I have trouble getting to sleep before about 3am. The reasons for this are both contentious and boring, but obviously, falling asleep at 3am isn’t compatible with most of the things people like to get done in our society, unless you want to be doing them after less than five hours sleep. Because people often make suggestions about how I could get to sleep earlier, and because I am a gigantic, tragic nerd, I started collecting information about my sleeping patterns about a year ago. The graph below shows the variation in the time I fall asleep. It ranges between a 11.45pm and 8am (excluding the one outlier at 10pm, when I was sick). 50% of the time, it’s between 1.45am and 4am, with an average of 3am.
The aim of the data collection was to work out which modifiable factors have a significant impact on the time I fall asleep, and how profound any impact is. Part of this was certainly the spite of a chronic insomniac wanting a justification to tell anybody who says, “Hurr, durr, just get up earlier” where to stick it, but also because I wanted to check whether my intuitions about what makes a difference were at all accurate. There have been times when I was travelling or got lazy that I don’t have data for, so after a year, I have complete information on about 170 nights, and the following variables, all of which are supposed to affect sleep:
- Caffeine (yes or no; before or after 2pm)
- Exercise (yes or no)
- Alcohol, ie, did I stay out until 3am like an eejut (yes or no)
- Vitamin D (yes or no)
- Melatonin (yes or no; dose)
- Employment type (one was 9 to 5, one was 12pm – 5pm, baseline is unemployed or working from home)
- Hours sleep the previous night
- Time I woke up that day
The results are as follows. If you understand the table, you can skip the three paragraphs directly underneath it.
The second column is the “point estimate”, that is the estimated time, in minutes, that a “yes” or a one unit increase in the amount of the variable (ie hours of sleep the night before) adds to the time I fall asleep. A negative sign before that number means I fall asleep earlier if the answer is “yes” or the amount of the thing increases. The p value in the third column is the strength of the correlation – the smaller the number, the stronger the association between changes in that variable and changes in the time I fall asleep (generally we scienticians say that <0.05 is moderate, <0.01 is strong, and <0.001 is very strong). Variables in bold are the ones the computer thinks have at least a moderate relationship with the time I fall asleep.
The columns to the far right are the 95% confidence intervals, that is the range of values the computer thinks the “true” value of its point estimate probably lies within, as the estimate itself may not be perfectly accurate – for example, the computer has calculated that caffeine after 2pm adds an average of 76 minutes to the time I fall asleep, but it could be as many as 115 minutes or as few as 36 minutes. Based on the information it’s been given, the computer thinks it’s almost certainly somewhere within that range. The closer these two values are to one another, the more confident the computer is about its point estimate of the impact of that variable. I’ve only included point estimates and confidence intervals for variables the computer thought had a strong association with the time I fall asleep (because calculating them from the output my stats program gives me is annoying!).
The other thing to note is that each point estimate accounts for the impact of changes in the other variables. So for example if I’ve had eight hours asleep, waking up at 9am instead of 10am might make me fall asleep 10 minutes earlier. But if I’ve woken up at 10am, having seven hours sleep instead of eight apparently makes no difference – the time I wake up is more important than the time I fall asleep. The variables with more than two “types” are both compared to a baseline value of “none” – so the higher dose of melatonin subtracts 77 minutes relative to no melatonin, not relative to the lower dose.
Welcome back, table-understanders. The thing that leaps out at me from here is that the point estimate for waking up earlier, per hour, is not one. That is, waking up one hour earlier does not mean I fall asleep one hour earlier, and in fact, to fall asleep one hour earlier, I’d apparently have to get up six hours earlier, with a net loss of five hours sleep in the morning to gain one hour extra at night. I’m not sure if that’s normal or not, I’d be curious to hear from say, a shift worker, as to whether they think it happens to them as well. If the average person started waking up at 2am instead of 7am, would they eventually adjust and start falling asleep at 6pm instead of 11pm? Or will our internal clocks only allow us to move so far?
Beyond direct effects of the previous night’s sleep, either dose of melatonin moves me about an hour and a quarter backwards, which is substantial. Caffeine adds 45min if I have it before 2pm, and an hour and a quarter if I have it after 2pm. Alcohol is really just in there to prevent it confusing the other results – I obviously can’t fall asleep at 1am if I’m socialising until 3am. Working 9 to 5 three days a week was clearly not great, which I could definitely have told you at the time. I was getting up at 7am some days and sleeping in until 2pm others in an attempt to catch up, which was disastrous.
Following on from the job variable, I created a variable a few months ago which is a measure of the variation in the times I’d woken up over the previous week, as getting up at the same time each day is supposed to help. Because of my patchy record keeping, though, I’ve only got it for 170 nights, which drops the total number of nights available to the program from 173 to 122 (it has to drop any nights missing any data on any variable). At this stage there’s no significant association between it and the time I fall asleep, but that might change with more data.
There are other limitations of the dataset at present. Some variables have ended up with really unbalanced numbers of observations – for example I have 236 days with caffeine (134 <2pm; 66 >2pm), and only 35 without – and that makes the estimates of the effects less certain than they would otherwise be. It seems unlikely to me that the time I have it is actually irrelevant, but the way I’ve recorded it doesn’t allow the computer to distinguish between 7am and 1pm, or 2.30pm and 8pm. In reality I would normally only drink coffee between 11am and 3pm anyway, so I guess it doesn’t really matter. I am going to try to pad out the number of days without it, though, and see what happens.
Modafinil is a drug I was prescribed to help with daytime fatigue that apparently, theoretically, allegedly, doesn’t disturb sleep. Whatever you say, Doc. Seth Roberts has blogged about vitamin D supplementation improving his sleep. I haven’t found that, although having taken enough to change my status from deficient to non-deficient, I definitely feel less tired during the day than I did before I was taking high doses.
“Exercise” is necessarily crude, because there’s no easy way to accurately quantify the effect of type, time or intensity. So far I’ve been scoring walking and swimming as “1” and more intensive things (interval training, weights, diving) as “2” in a separate variable, but doing this retrospectively makes me worry about the accuracy, so I’ve left it as yes or no in this analysis. I do suspect that intense exercise helps, but I might need more consistent data in future to look at that properly.
So, in summary, melatonin definitely helps, caffeine definitely doesn’t, and modafinil is an unholy disaster. Vitamin D doesn’t appear to make a difference, and exercise may or may not, but my difficulty in coding it might be causing some confusion.