/
Zeo.page
3027 lines (2409 loc) · 197 KB
/
Zeo.page
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: Zeo sleep experiments
description: EEG recordings of sleep and my experiments with things affecting sleep quality or durations
created: 28 Dec 2010
tags: experiments, biology, psychology, DNB, nootropics, statistics, predictions
status: in progress
belief: likely
...
> I discuss my beliefs about Quantified Self, and demonstrate with a series of [single-subject design](!Wikipedia) self-experiments using a Zeo. A Zeo records sleep via EEG; I have made many measurements and performed many experiments. This is what I have learned so far:
>
> 1. the Zeo headband is wearable long-term
> 2. [melatonin](#melatonin) improves my sleep
> 3. [one-legged standing](#one-legged-standing) does little
> 4. Vitamin D ([at night](#vitamin-d-at-night-hurts)) damages my sleep
> 5. Vitamin D ([in morning](#vitamin-d-at-morn-helps)) does not affect my sleep
> 6. potassium ([over the day](#potassium-day-use) but not so much [the morning](#potassium-morning-use)) damages my sleep and does not improve my mood/productivity
[Quantified Self](!Wikipedia) (QS) is a movement with many faces and as many variations as participants, but the core of everything is this: experiment with things that can improve your life.
<!-- QS links
http://lesswrong.com/lw/dms/open_thread_july_1631_2012/74eg?context=3
http://www.sebastianmarshall.com/what-gets-measured-gets-managed
Roberts 2004, "Self-experimentation as a source of new ideas: Ten examples about sleep, mood, health, and weight" http://www.stat.columbia.edu/~gelman/stuff_for_blog/selfexp.pdf
citations of above http://scholar.google.com/scholar?cites=1711925790230211471&as_sdt=20005&sciodt=0,9&hl=en
http://pubmedcentralcanada.ca/pmcc/articles/PMC3298919/?lang=en-ca
Ebbinghaus's discovery of spaced repetition as self-experiment
http://www.theatlantic.com/magazine/archive/2012/07/the-measured-man/309018/?single_page=truein inflammation
http://www.sleepfoundation.org/article/press-release/annual-sleep-america-poll-exploring-connections-communications-technology-use-
http://quantifiedself.com/2012/08/vahe-kassardjian-and-rafi-haladjian-on-crossing-the-data-desert/ Only one task at a time!
meta-analysis: http://lesswrong.com/lw/e3a/open_thread_august_1631_2012/7azp?context=3
http://lesswrong.com/r/discussion/lw/eck/how_to_tell_apart_science_from_pseudoscience_in_a/7c2y
http://blog.givewell.org/2012/08/23/how-we-evaluate-a-study/
http://blog.givewell.org/2012/09/06/surveying-the-research-on-a-topic/
http://norvig.com/experiment-design.html
https://www.nytimes.com/2010/05/02/magazine/02self-measurement-t.html?_r=1&ref=magazine&pagewanted=all
http://mobihealthnews.com/22410/can-personal-health-data-motivate-behavioral-change-it-depends/
https://moalquraishi.wordpress.com/2013/07/24/10-months-at-harvard-quantified/
http://www.wired.com/magazine/2011/06/ff_feedbackloop/all/
-->
# What is QS?
Quantified Self is not expensive devices, or meet-ups, or videos, or even ebooks telling you what to do. Those are tools to an end. If reading this page does anything, my hope is to pass on to some readers the Quantified Self *attitude*: a playful thoughtful attitude, of wondering whether this thing affects that other thing and what implications could be easily tested. "Science" without the capital "S" or the belief that only scientists are allowed to think.
That's all Quantified Self is, no matter how simple or complicated your devices, no matter how automated your data collection, no matter whether you found a pedometer lying around or hand-engineered your own EEG headset.
Quantified Self is simply about having ideas, gathering some data, seeing what it says, and improving one's life based on the data. If gathering data is too hard and would make your life worse off - then don't do it! If the data can't make your life better - then don't do it! Not every idea can or should be tested.
The QS cycle is straightforward and flexible:
1. Have an idea
2. Gather data
3. Test the data
4. Make a change; GOTO 1
Any of these steps can overlap: you may be collecting sleep data long before you have the idea (in the expectation that you *will* have an idea), or you may be making the change as part of the data in an experimental design, or you may inadvertently engage in a "natural experiment" before wondering what the effects were (perhaps the baby wakes you up on random nights and lets you infer the costs of poor sleep).
The point is not publishable scientific rigor. If you are the sort of person who wants to run such rigorous self-experiments, fantastic! The point is making your life better, for which scientific certainty is not necessary: imagine you are choosing between equally priced sleep pills and equal safety; the first sleep pill will make you go to sleep faster by 1 minute and has been validated in countless scientific trials, and while the second sleep pill has in the past week has ended the sweaty nightmares that have plagued you every few days since childhood but alas has only a few small trials in its favor - which would you choose? I would choose the second pill!
To put it in more economic/statistical terms, what we want from a self-experiment is for it to give us a confidence just good enough to tell whether the expected value of our idea is more than the idea will cost. But we don't need more confidence unless we want to persuade other people! (So from this perspective, it is possible to do a QS self-experiment which is "too good". Much like one can overpay for safety and buy too much insurance - like [extra warranties](Console Insurance) on electronics such as video game consoles, a notorious rip-off.)
## What QS Is Not: (Just) Data Gathering
One failure mode which is particularly dangerous for QSers is to overdo the data collection and collect masses of data they never *use*. Famous computer entrepreneur & mathematician [Stephen Wolfram](!Wikipedia) exemplified this for me in March 2012 with his lengthy blog post ["The Personal Analytics of My Life"](http://blog.stephenwolfram.com/2012/03/the-personal-analytics-of-my-life/) in which he did some impressive graphing and exploration of data from 1989 to 2012: a third of a million (!) emails, full keyboard logging, calendar, phone call logs (with missed calls include), a pedometer, revision history of his tome [_A New Kind of Science_](http://www.amazon.com/New-Kind-Science-Stephen-Wolfram/dp/1579550088/), file types accessed per date, parsing scanned documents for dates, a treadmill, and perhaps more he didn't mention.
Wolfram's dataset is well-depicted in informative graphs, breathtaking in its thoroughness, and even more impressive for its duration. So why do I read his post with sorrow? I am sad for him because I have read the post several times, and as far as I can see, he has not benefited in any way from his data collection, with [one minor exception](http://www.technologyreview.com/news/514356/stephen-wolfram-on-personal-analytics/ "Stephen Wolfram on Personal Analytics: The creator of the Wolfram Alpha search engine explains why he thinks your life should be measured, analyzed, and improved"):
> Very early on, back in the 1990s, when I first analyzed my e-mail archive, I learned that a lot of e-mail threads at my company would, by a certain time of day, just resolve themselves. That was a useful thing to know, because if I jumped in too early I was just wasting my time.
Nothing else in his life was better 1989-2012 because he did all this, and he shows no indication that he will benefit in the future (besides having a very nifty blog post). And just reading through his post with a little imagination suggests plenty of experiments he could do:
1. He mentions that 7% of his keystrokes are the Backspace key.
This seems remarkably high and must be slowing down his typing by a nontrivial amount. Why doesn't he try a typing tutor to see if he can improve his typing skill, or learn the keyboard shortcuts in his text editor? If he is wasted >7% of all his typing (because he had to type what he is Backspacing over, of course), then he is wasting typing time, slowing things done, adding frustration to his computer interactions and worst, putting himself at greater risk of crippling RSI.
2. How often does he access old files? Since he records access to all files, he can ask whether all the logging is paying for itself.
3. Is there any connection between the steps his pedometer records and things like his mood or emailing? Exercise has been linked to many benefits, both physical and mental, but on the other hand, walking isn't a very quick form of exercise. Which effect predominates? This could have the practical consequence of scheduling a daily walk just as he tries to make sure he can have dinner with his family.
4. Does a flurry of emails or phone calls disrupt his other forms of productivity that day? For example, while writing his book would he have been better off barricading himself in solitude or working on it in between other tasks?
5. His email counts are astonishingly high in general:
Is answering so many emails *really* necessary? Perhaps he has put too much emphasis on email communication, or perhaps this indicates he should delegate more - or if running [Mathematica](!Wikipedia) is so time-consuming, perhaps he should re-evaluate his life and ask whether that is what he truly wants to do now. I have no idea what the answer to any of these questions are or whether an experiment of any kind could be run on them, but these are key life decisions which could be prompted by the data - but weren't.
Another QS piece(["It's Hard to Stay Friends With a Digital Exercise Monitor"](http://www.nytimes.com/2012/07/29/technology/nike-fuelband-tracks-physical-activity-inconsistently.html)) struck me when the author, Jenna Wortham, reflected on her experience with her [Nike+ FuelBand](!Wikipedia) motion sensor:
> The forgetfulness and guilt I experienced as my FuelBand honeymoon wore off is not uncommon, according to people who study behavioral science. The collected data is often interesting, but it is hard to analyze and use in a way that spurs change. "It doesn't trigger you to do anything habitually," said Michael Kim, who runs Kairos Labs, a Seattle-based company specializing in designing social software to influence behavior...Mr. Kim, whose résumé includes a stint as director of Xbox Live, the online gaming system created by Microsoft, said the game-like mechanisms of the Nike device and others like it were "not enough" for the average user. "Points and badges do not lead to behavior change," he said.
One thinks of [a saying](http://deming.org/index.cfm?content=653 "Four Days with W. Edwards Deming") of [W. Edwards Deming](!Wikipedia): "Experience by itself teaches nothing." Indeed. A QS experiment is a 4-legged beast: if any leg is far too short or far too long, it can't carry our burdens.
And with Wolfram and Wortham, we see that 2 legs of the poor beast have been amputated. They collected data, but they had no ideas and they made no changes in their life; and because QS was not part of their life, it soon left their life. Wortham seems to have dropped the approach entirely, and Wolfram may only persevere for as long as the data continues to be useful in demonstrating the abilities of his company's products.
# Zeo QS
On Christmas 2010, I received one of [Zeo Inc](!Wikipedia "Zeo, Inc.")'s (founded 2003, [shutting down 2013](http://mobihealthnews.com/20772/exclusive-sleep-coach-company-zeo-is-shutting-down/ "Exclusive: Sleep coach company Zeo is shutting down")) Zeo bedside unit after long coveting it and dreaming of using it for all sorts of sleep-related questions. (As of February 2013, the bedside unit seems to've been discontinued; the most comparable Zeo Inc. product seems to be the [Zeo Sleep Manager Pro](http://www.amazon.com/Zeo-ZEO301-Sleep-Manager-Pro/dp/B008I20LJ2/), ~$90.) With it, I begin to apply my thoughts about Quantified Self.
A Zeo is a scaled-down (one-electrode) [EEG](!Wikipedia) sensor-headband, which happens to have an alarm clock attached. The EEG data is processed to estimate whether one is asleep and what [stage](!Wikipedia "Sleep#Physiology") of sleep one is in. Zeo breaks sleep down into waking, [REM](!Wikipedia "Rapid eye movement sleep"), [light](!Wikipedia "Non-rapid eye movement sleep"), and [deep](!Wikipedia "Slow-wave sleep"). (The phases aren't necessarily that physiologically distinct.) It's been compared with regular [polysomnography](!Wikipedia) by [Zeo Inc and others](http://web.archive.org/web/20130515062508/http://www.myzeo.com/sleep/validation) and seems to be reasonably accurate. (Since regular sleep tests cost thousands of dollars per session and are of questionable external validity since they are a very different setting than your own bedroom, I am fine with a Zeo being just "reasonably" accurate.)
The data is much better than what you would get from more popular methods like cellphones with accelerometers, since an accelerometer only knows if you are moving or not, which isn't a very reliable indicator of sleep[^Fitbit]. (You could just be lying there staring at the ceiling, wide awake. Or perhaps the cat is kneading you while you are in light sleep.) As well, half the interest is how exactly sleep phases are arranged and how long the cycles are; you could use that information to devise [a custom polyphasic schedule](http://web.archive.org/web/20130528120222/http://blog.myzeo.com/sleeping-round-the-clock-a-polyphasic-experiment/) or just figure out a better nap length than the rule-of-thumb of 20 minutes. And the price isn't *too* bad - $150 for the normal Zeo as of February 2012. (The basic mobile Zeo is much cheaper, but I've seen people complain about it and apparently it doesn't collect the same data as more expensive mobile version or the original bedside unit.)
[^Fitbit]: The obvious and cheaper alternative to the Zeo would be the [Fitbit](!Wikipedia), one of the accelerometers. There aren't many comparisons; [Diana Sherman](http://www.healthyobsessions.net/2010/11/fitbit-zeo-sleep-cycle-1/) compared one night, and [Joe Betts-LaCroix](http://vimeo.com/28735982) compared ~38 nights of data. In both cases, the Fitbit seemed to be pretty similar to the Zeo at estimating total sleep time (the only thing it can measure). Betts-LaCroix explicitly recommends the Zeo, but I'm not clear on whether that is due to the better data quality or because Fitbit made it hard to impossible for him to extract the detailed Fitbit data while Zeo offers easy exporting. In any case, I already have the Zeo and I've come to like the detailed information.
# Tests
> "A thinker sees his own actions as experiments & questions - as attempts to find out something. Success and failure are for him *answers* above all." --[Friedrich Nietzsche](!Wikipedia), _[The Happy Science](!Wikipedia)_ #41
I personally want the data for a few distinct purposes, but in the best Quantified Self vein, mostly experimenting:
1. more thoroughly quantifying the benefits of [melatonin](Melatonin)
- and dose levels: 1.5mg may be too much. I should experiment with a variety: 0.1, 0.5, 1.0, 1.5, and 3mg?
2. quantifying the costs of [modafinil](Modafinil)
3. testing benefits of [huperzine-A](!Wikipedia)[^Ferriss]
4. designing & starting [polyphasic sleep](!Wikipedia)
5. assisting [lucid dreaming](!Wikipedia)
6. reducing sleep time in general (better & less sleep)
7. investigating effects of [n-backing](DNB FAQ):
- do n-backing just before sleep, and see whether percentages shift (more deep sleep as the brain grows/changes?) or whether one sleeps better (fewer awakenings, less light sleep).
- do n-backing after waking up, to look for correlation between good/bad sleeps and performance (one would expect good sleep ~> good scores).
- test the costs of polyphasic sleep on memory^[My own suspicion is that given the existence of [neuron-level sleep in mice](http://www.cosmosmagazine.com/news/4264/can-we-be-awake-and-asleep-same-time), [poor self-monitoring in humans](http://www.nytimes.com/2011/04/17/magazine/mag-17Sleep-t.html), and [anecdotal reports](http://lesswrong.com/lw/5n0/optimizing_sleep/44zu) about polyphasic sleep, is that polyphasic sleep is a real & workable phenomenon but that it comes at the price of a large chunk of mental performance.]
8. (positive) effect of [Seth Roberts](!Wikipedia)'s [one-legged standing](http://blog.sethroberts.net/2011/03/22/effect-of-one-legged-standing-on-sleep/) on sleep depth/efficiency
10. possible sleep reductions due to meditation
11. serial cable uses:
- quantifying meditation (eg. length of gamma frequencies)
- rank music by distractibility?
- measure focus over the day and during specific activities (eg. correlate frequencies against n-backing performance)
12. testing benefit of using [Redshift](http://jonls.dk/redshift/)/f.lux to adjust monitor color temperature
13. Measure negative effect of nicotine on sleep & determine appropriate buffer
14. test claims of sleep benefits from magnesium
15. [caffeine pill](http://www.aleph.se/andart/archives/2007/11/the_early_bird_gets_the_caffeine_pill.html) [wake-up trick](http://lesswrong.com/r/discussion/lw/h2m/solved_problems_repository/8ol7)
I have tried to do my little self-experiments as well as I know how to, and hopefully my results are less bogus than the usual anecdotes one runs into online. What I would really like is for other people (especially Zeo owners) to *replicate* my results. To that end I have taken pains to describe my setups in complete detail so others can use it, and provided the data and complete [R](!Wikipedia "R (programming language)") or [Haskell](!Wikipedia "Haskell (programming language)") programs used in analysis. If anyone replicates my results in any fashion, please contact me and I would be happy to link your self-experiment here!
[^Ferriss]: I had previously [tried](Nootropics#huperzine-a) huperzine-A and subjectively noticed no effect from it, but I had no way of really noticing any effect on sleep, and [Timothy Ferriss](!Wikipedia) in his [_The Four-hour Body_](http://www.amazon.com/4-Hour-Body-Uncommon-Incredible-Superhuman/dp/030746363X/) claims:
> Taking 200 milligrams of huperzine-A 30 minutes before bed can increase total REM by 20-30%. Huperzine-A, an extract of _Huperzia serrata_, slows the breakdown of the neurotransmitter acetylcholine. It is a popular nootropic (smart drug), and I have used it in the past to accelerate learning and increase the incidence of lucid dreaming. I now only use huperzine-A for the first few weeks of language acquisition, and no more than three days per week to avoid side effects. Ironically, one documented side effect of overuse is insomnia. The brain is a sensitive instrument, and while generally well tolerated, this drug is contraindicated with some classes of medications. Speak with your doctor before using.
# First impressions
## First night
Christmas morning, I unpacked it and admired the packaging, and then looked through the manual. The base-station/alarm-clock seems pretty sturdy and has a large clear screen. The headband seemed comfortable enough that it wouldn't bother me. The various writings with it seemed rather fluffy and preppy, but I did my technical homework before hand, so could ignore their crap.
Late that night (quite late, since the girls stayed up playing _[Fable 3](!Wikipedia)_ and Xbox [Kinect](!Wikipedia) dancing games and what not), I turn in wearily. I had noticed that the alarm seemed to be set for ~3:30 AM, but I was very tired from the long day and taking my melatonin, and didn't investigate further - I mean, what electronic would ship with the alarm both enabled and enabled for a bizarre time? It wasn't worth bothering the other sleeper by turning on the light and messing with it. I put on the headband, verified that the Zeo seemed to be doing stuff, and turned in. Come 3 AM, and the damn music goes off! I hit snooze, too discombobulated to figure out how to turn off the alarm.
So that explains the strange Zeo data for the first day:
![First night](/images/zeo/2010-12-25.png)
The major surprise in this data was how quickly I fell asleep: 18 minutes. I had always thought that I took much longer to fall asleep, more like 45 minutes, and had budgeted accordingly; but apparently [being deluded](http://web.archive.org/web/20120628120817/http://blog.myzeo.com/sleep-forgetting-to-remember-to-forget/) about when you are awake and asleep is common - which leads into [an interesting philosophical point](Prediction markets#modus-tollens-vs-modus-ponens): if your memories disagree with the Zeo, who should you believe? The rest of the data seemed too messed up by the alarm to learn anything from.
# Uses
## Meditation
One possible application for Zeo was meditation. Most meditation studies are [very small & methodologically weak](http://archive.ahrq.gov/downloads/pub/evidence/pdf/meditation/medit.pdf "'Meditation Practices for Health: State of the Research', Ospina et al 2007"), so it might be worthwhile to verify for oneself any interesting claims. If Zeo's measuring via EEG, then presumably it's learning something about how relaxed and activity-less one's mind is. I'm not seeking enlightenment, just calmness, which would seem to be in the purview of an EEG signal. (As Charles Babbage said. errors made using insufficient data are still less than errors made using no data at all.) But alas, I meditated for a solid 25 minutes and the Zeo stubbornly read at the same wake level the entire time; I then read my [Donald Keene](!Wikipedia) book, [_Modern Japanese diaries_](http://www.amazon.com/Modern-Japanese-Diaries-Donald-Keene/dp/0231114435/), for a similar period with no change at all. It is possible that the 5-minute averaging (Zeo measures every 2 seconds) is hiding useful changes, but probably it's simply not picking up any real differences. Oh well.
## Smart alarm
The second night I had set the alarm to a more reasonable time, and also enabled its smart alarm mode (["SmartWake"](http://web.archive.org/web/20121203132823/http://blog.myzeo.com/smartwake-a-different-way-to-wake-up/)), where the alarm will go off up to 30 minutes early if you are ever detected to be awake or in light sleep (as opposed to REM or deep sleep). One thing I forgot to do was take my melatonin; I keep my supplements in the car and there was a howling blizzard outside. It didn't bother me since I am not addicted to melatonin.
In the morning, the smart alarm mode seemed to work pretty well. I woke up early in a good mode, thought clearly and calmly about the situation - and went back to sleep. (It's a holiday, after all.)
## Replacing headband
Around 15 May 2011, I gave up on the original headband - it was getting too dirty to get good readings - and decided to rip it apart to see what it was made of, and to order a new set of three for \$35 (which seems reasonable given the expensive material that the contacts are made of - silver fabric); they then [cost \$50](http://web.archive.org/web/20120605135712/http://www.myzeo.com/sleep/shop/zeo-accessories/zeo-bedside-headband-sensor-replacement-kit-x-3.html). A little googling found me a coupon, `FREESHIP`, but apparently it only applied to the Zeo itself and so the pads were actually \$40, or ~\$13 a piece. I won't say that buying replacement headbands semi-annually is something that *thrills* me, but \$20 a year for sleep data is a small sum. Certainly it's more cost-effective than most of the [nootropics](Nootropics) I have used. (Full disclosure: 9 months after starting this page, Zeo [offered me](#comment-309924264) a free set of sensors. I used them and when the news broke about Zeo going out of business, I bought another set.)
![The old headband, with electrical tape residue](/images/zeo/zeo-headband-original.jpg) ![The disposable headband with the cloth covering removed](/images/zeo/zeo-headband-deconstructed.jpg)/
![Said headband with plastic removed; notice discoloration of metal despite cleaning](/images/zeo/zeo-headband-fabric1.jpg) ![The reverse side](/images/zeo/zeo-headband-fabric2.jpg)/
![The new headband's wrapper](/images/zeo/zeo-wrapper.jpg) ![The new headband](/images/zeo/zeo-new-headband.jpg)/
In the future, I might try to make my own; [eok.gnah](http://www.flickr.com/photos/eokgnah/5489407407/) claims that buying the silver fabric is apparently cheaper than ordering from Zeo, marciot [reports success in making headbands](http://www.instructables.com/id/DIY-Replacement-Zeo-Sleep-Monitor-Headband-Sensor/), and it seems one can even [hook up other sensors](http://web.archive.org/web/20120107073301/http://www.myzeo.com/sleep/node/594) to the headband. Another alternative is, since the Zeo headband is a one-electrode EEG headset, to take an approach similar to the EEG people and occasionally add small dabs of conductive paste, since fairly large quantities are cheap (eg. [12oz for $30](http://www.amazon.com/Ten20-EEG-Conductive-Paste-Tube/dp/B002R16OUK)). There was a [disposable adhesive gel ECG electrodes with offset press-stud connections](https://forum.quantifiedself.com/thread-zeo-shutting-down-export-your-data?pid=3412#pid3412) being experimented with by Zeo Inc, but they never entered wide use before it shut down.
# Melatonin
Before writing my [melatonin advocacy](Melatonin) article, I had used melatonin regularly for 6+ years, ever since I discovered (somewhen in high school or college) that it was useful for enforcing bedtimes and seemed to improve sleep quality; when I [posted my writeup to LessWrong](http://lesswrong.com/lw/1lt/case_study_melatonin/#comments) people were naturally a little skeptical of my specific claim that it improved the quality of my sleep such that I could reduce scheduled time by an hour or so. Now that I had a Zeo, wouldn't it be a good idea to see whether it did anything, lo these many years later?
The [following section](#melatonin-data) represents 5 or 6 months of data ([raw CSV data](/docs/zeo/2011-zeo-melatonin.csv); [guide to Zeo CSV](http://web.archive.org/web/20120606152734/http://mysleep.myzeo.com/export/Export%20Data%20Help%20Sheet.pdf "The Export Data feature allows you to download all of your sleep data, journal entries, bedside display settings and more into a spreadsheet readable format (CSV). This help sheet describes how you can interpret your exported sleep data in its CSV format.")). My basic dosage was 1.5mg of melatonin taken 0-30 minutes before going to sleep.
## Graphic
Deep sleep and 'time in wake' were both apparently unaffected; 'time in wake' apparently had too small a sample to draw much conclusion:
![](/images/zeo/melatonin-timedeep.png)
Surprisingly, total REM sleep fell:
![](/images/zeo/melatonin-timerem.png)
While the raw ZQ falls, the regression takes into account the correlated variables and indicates that this is something of an
![](/images/zeo/melatonin-zq.png)
REM's average fell by 29 minutes, deep sleep fell by 1 minute, but total sleep fell by 54 minutes; this implies that light sleep fell by 24 minutes. (The averages were 254.2 & 233.3) I am not sure what to make of this. While my original heuristic of a one hour reduction turns out to be surprisingly accurate, I had expected light and deep sleep to take most of the time hit. Do I get enough REM sleep? I don't know how I would answer that.
I did feel fine on the days after melatonin use, but I didn't track it very systematically. The best I have is the 'morning feel' parameter, which the Zeo asks you on waking up; in practice I entered the values as: a '2' means I woke feeling poor or unrested, '3' was fine or mediocre, and '4' was feeling good. When we graph the average of morning feel against melatonin use or non-use, we find that melatonin was noticeably better (2.95 vs 3.17):
![](/images/zeo/melatonin-morningfeel.png)
Graphing some more of the raw data:
![](/images/zeo/melatonin-totalz.png)
![](/images/zeo/melatonin-timeswoken.png)
Unfortunately, during this period, I didn't regularly do my [n-backing](DNB FAQ) either, so there'd be little point trying to graph that. What I spent a lot of my free time doing was editing `gwern.net`, so it might be worth looking at whether nights on melatonin correspond to increased edits the next day. In this graph of edits, the red dots are days without melatonin and the green are days with melatonin; I don't see any clear trend, although it's worth noting almost all of the very busy days were melatonin days:
![Days versus # of edits versus melatonin on/off](/images/zeo/melatonin-usage-versus-darcs.png)
## Melatonin analysis
The data is very noisy (especially towards the end, perhaps as the headband got dirty) and the response variables are intercorrelated which makes interpretation difficult, but hopefully the overall conclusions from the [multivariate linear analysis](!Wikipedia) are not entirely untrustworthy. Let's look at some average. Zeo's website lets you enter in a 3-valued variable and then graph the average day for each variable against a particular recorded property like ZQ or total length of REM sleep. I defined one dummy variable, and decided that a '0' would correspond to not using melatonin, '1' would correspond to using it, and '2' would correspond to using a double-dose or more (on the rare occasions I felt I needed sleep insurance). The following additional [NHST](!Wikipedia "Null hypothesis significance testing")-style[^Bayes] analyses of _p_-values is done by importing the CSV into R; given all the issues with self-experimentation (these melatonin days weren't even blinded), the _p_-values should be treated as gross guesses, where <0.01 indicates I should take it seriously, <0.05 is pretty good, <0.10 means I shouldn't sweat it, and anything bigger than 0.20 is, at most, interesting while >0.5 means ignore it; we'll also look at correcting for multiple comparisons[^Bonferroni], for the heck of it. A mnemonic: _p_-values are about whether the effect exists, and _d_-values are whether we care. For a visualization of effect sizes, see ["Windowpane as a Jar of Marbles"](http://healthyinfluence.com/wordpress/steves-primer-of-practical-persuasion-3-0/intro/windowpane/).
[^Bayes]: [Kruschke 2012](http://www.indiana.edu/~kruschke/BEST/BEST.pdf "Bayesian estimation supersedes the _t_ test") argues that there is no need for people to use the old framework of _p_-values and null hypotheses etc, with their many well-known philosophical difficulties and misleading interpretations - interpretations I, alas, perpetuate in my analyses with my use of statistical significance:
> Nevertheless, some people have the impression that conclusions from NHST and Bayesian methods tend to agree in simple situations such as comparison of two groups: "Thus, if your primary question of interest can be simply expressed in a form amenable to a t-test, say, there really is no need to try and apply the full Bayesian machinery to so simple a problem." ([Brooks, 2003](http://rsta.royalsocietypublishing.org/content/361/1813/2681.full.pdf "Bayesian computation: a statistical revolution"), p. 2694) This article shows, to the contrary, that Bayesian parameter estimation provides much richer information than the NHST t-test, and that its conclusions can differ from those of the NHST t-test. Decisions based on Bayesian parameter estimation are better founded than NHST, whether the decisions of the two methods agree or not. The conclusion is bold but simple: Bayesian parameter estimation supersedes the NHST t-test.
Unfortunately, while I have no love for NHST, I *did* find it much easier to use the NHST concepts & code when learning how to do these analyses. In the future, hopefully I can switch to Bayesian techniques.
The analysis session in the `R` interpreter:
~~~{.R}
# Read in data w/ variable names in header; uninteresting columns deleted in OpenOffice.org
zeo <- read.csv("http://www.gwern.net/docs/zeo/2011-zeo-melatonin.csv")
# "Melatonin" was formerly "SSCF 10";
# I also edited the CSV to convert all '3' to '1' (& so a binary)
R> l <- lm(cbind(ZQ, Total.Z, Time.to.Z, Time.in.Wake, Time.in.REM,
Time.in.Deep, Awakenings, Morning.Feel, Time.in.Light)
~ Melatonin, data=zeo)
R> summary(manova(l))
Df Pillai approx F num Df den Df Pr(>F)
Melatonin 1 0.102 0.717 9 57 0.69
Residuals 65
R> summary(l)
Response ZQ :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 83.52 4.13 20.21 <2e-16
Melatonin 2.43 4.99 0.49 0.63
Response Total.Z :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 452.38 22.86 19.79 <2e-16
Melatonin 9.68 27.59 0.35 0.73
Response Time.to.Z :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 19.48 2.59 7.52 2.1e-10
Melatonin -5.04 3.13 -1.61 0.11
Response Time.in.Wake :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.095 1.521 4.66 1.6e-05
Melatonin -0.247 1.836 -0.13 0.89
Response Time.in.REM :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 144.62 9.38 15.41 <2e-16
Melatonin -3.73 11.32 -0.33 0.74
Response Time.in.Deep :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 54.33 3.26 16.68 <2e-16
Melatonin 5.56 3.93 1.41 0.16
Response Awakenings :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.095 0.524 5.90 1.4e-07
Melatonin -0.182 0.633 -0.29 0.77
Response Morning.Feel :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.952 0.142 20.78 <2e-16
Melatonin 0.222 0.171 1.29 0.2
Response Time.in.Light :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 253.86 13.59 18.68 <2e-16
Melatonin 7.93 16.40 0.48 0.63
~~~
[^melatonin-multiple]: If we correct for multiple comparisons (see [previous footnote](#fn7)) at _q_-value=0.05, none of them survive:
~~~{.R}
R> p.adjust(c(0.11,0.77,0.89,0.16,0.63,0.74,0.73,0.63,0.20), method="BH") < 0.05
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
~~~
Oh well.
[^Bonferroni]: The usual way to correct for the issue of multiple comparisons inflating results (a big problem in epidemiology and why their results are so often false) is to use a [Bonferroni correction](!Wikipedia) - if I look at the _p_-values for 7 Zeo metrics, I wouldn't consider any to be statistically-significant at '_p_=0.05' unless they were actually statistically-significant at $\frac{0.05}{7} = 0.00714 = 0.007$, which is even more stringent than the rarer '_p_=0.01' criterion. With the even stronger criterion '_p_=0.007', it's a safe bet than *none* of my tests give statistically-significant results. Which may be the right thing to conclude, since all my data is just _n_=1 and unreliable in many ways, but still, the Bonferroni correction is not being very helpful here.
The caveat is that the Bonferroni correction is intended for use on 'independent' data, while the Zeo metrics are all very dependent, some by *definition* (eg. ZQ is defined partly as what the REM sleep length was, AFAIK). So while the Bonferroni correction will still do the job of only letting through *really* statistically-significant data, it'll do so by throwing out way more potentially good results than one has to. (It'll avoid some false positives by making many false negatives.) So what should we do?
[Andy McKenzie](http://lesswrong.com/lw/9ui/ask_for_help_on_your_project_open_thread/5ump#thingrow_t1_5ump) suggested limiting our [false discovery rate](!Wikipedia) by using the method of [Benjamin & Hochberg 1995](http://www.math.tau.ac.il/~ybenja/MyPapers/benjamini_hochberg1995.pdf "Controlling the False Discovery Rate: a Practical and Powerful Approach to Multiple Testing"):
> ...let's say that you test 6 hypotheses, corresponding to different features of your Zeo data. You could use a t-test for each, as above. Then aggregate and sort all the _p_-values in ascending order. Let's say that they are 0.001, 0.013, 0.021, 0.030, 0.067, and 0.134.
>
> Assume, arbitrarily, that you want the overall false discovery rate to be 0.05, which is in this context called the _q_-value. You would then sequentially test, from the last value to the first, whether the current _p_-value is less than $\frac{\text{the current index} \times \text{the false discovery rate}}{\text{the overall number of hypotheses}}$. You stop when you get to the first true inequality and call the _p_-values of the rest of the hypotheses [statistically-]significant.
>
> So in this example, you would stop when you correctly call $0.030 \lt \frac{4 \times 0.05}{6}$, and only the hypotheses corresponding to the first four [smallest] _p_-values would be called [statistically-]significant.
The [MANOVA](!Wikipedia) indicates no statistically-significant difference between the groups of days, taking all variables into account (_p_=0.69). To summarize the regression:
Variable Correlate/Effect _p_-value Coefficient's sign is...
------------ ---------------- ----------- -------------------------
`Time.to.Z` -5.04 0.11 better
`Awakenings` -0.18 0.77 better
`Time.in.Wake` -0.25 0.89 better
`Time.in.Deep` 5.56 0.16 better
`Time.in.Light` 7.93 0.63 worse
`Time.in.REM` -3.73 0.74 worse
`Total.Z` 9.68 0.73 better
`ZQ` 2.43 0.63 better
`Morning.Feel` 0.22 0.20 better
Part of the problem is that too many days wound up being useless, and each day costs us information and reduces our *true* sample size. (None of the metrics are strong enough to survive multiple correction[^melatonin-multiple], sadly.)
And also unfortunately, this dataseries doesn't distinguish between addition to melatonin or benefits from melatonin - perhaps the 3.2 is my 'normal' sleep quality and the 2.9 comes from a 'withdrawal' of sorts. The research on melatonin doesn't indicate any addiction effect, but who knows?
If I were to run further experiments, I would definitely run it double-blind, and maybe even test <1.5mg doses as well to see if I've been taking too much; 3mg turned out to be excessive, and there are one or two studies indicating that <1mg doses are best for normal people. I wound up using 1.5mg doses. (There could be 3 conditions: placebo, 0.75mg, and 1.5mg. For looking at melatonin effect in general, the data on 2 dosages could be combined. Melatonin has a short half-life, so probably there would be no point in random [blocks](!Wikipedia "Blocking (statistics)") of more than 2-3 days[^blocking]: we can randomize each day separately and assume that days are independent of each other.)
[^blocking]: "Blocking" is a style of variation on a simple randomized design where instead of considering each day separate and randomizing a single day, we instead randomize pairs of days, or more; so instead of flipping our coin to decide whether 'this week' is placebo, we flip our coin to decide whether 'this week will be placebo & next active' or 'this week active & next placebo'. This has 2 big advantages which justify the complexity:
1. Often, I'm worried about simple randomization leading to an imbalance in sample vs experimental; if I'm only getting 20 total datapoints on something, then randomization could easily lead to something like 14 control and 6 experimental datapoints - throwing out a lot of statistical power compared to 10 control and 10 experimental! Why am I losing power? Because data is subject to [diminishing returns](!Wikipedia): each new point reduces the standard error of your estimates less than the previous one did (since the total error shrinks as, roughly, inverse of the square root of the total sample size; the difference between √1 and √2 is bigger and shrinks error more than √2 vs √3, etc) . So the extra 4 control datapoints reduce the error less than the lost 4 experimental datapoints would have, and this leaves me with a final answer less precise than if it had been exactly 10:10. (If diminishing returns isn't intuitive, imagine taking it to an extreme: is 10:10 just as good as 5:15? As good as 2:18? How about *0*:20?) But if I pair days like this, then I *know* I will get exactly 10:10.
2. Blocking is the natural way to handle multiple-day effects or trends: if I think lithium operates slowly, I will pair entire weeks or months, rather than days and hoping enough experimental and control days form runs which will reveal any trend rather than wash it out in averaging.
Worth comparing are [Jayson Virissimo's preliminary results](http://jayquantified.blogspot.com/2012/08/melatonin-preliminary-results.html "Melatonin: Preliminary Results"):
> According to the preliminary [Zeo] data, while on melatonin, I seemed to get more total sleep, more REM sleep, less deep sleep, and wake up about the same number of times each night. Because this isn't enough data to be very confident in the results, I plan on continuing this experiment for at least another 4 months (2 on and 2 off of melatonin) and will analyze the results for the [statistical] significance and magnitude of the effects (if there really are any) while throwing out the outliers (since my sleep schedule is so erratic).
## Value of Information (VoI)
> See also the discussion as applied to [ordering modafinil](Modafinil#ordering-when-learning-isnt-free) and [testing nootropics](Nootropics#value-of-information-voi)
We all know it's possible to spend more time figuring out how to "save time" on a task than we would actually save time like rearranging books on a shelf or cleaning up in the name of efficiency (_xkcd_ even has a cute chart listing the break-even points for various possibilities,["Is It Worth The Time?"](http://xkcd.com/1205/)), and similarly, it's possible to spend more money trying to "save money" than one would actually save; less appreciated is that the same thing is also possible to do with gaining information.
The value of an experiment is the information it produces. What is the value of information? Well, we can take the economic tack and say value of information is the value of the decisions it *changes*. (Would you pay for a weather forecast about somewhere you are not going to? No. Or a weather forecast about your trip where you *have* to make that trip, come hell or high water? Only to the extent you can make preparations like bringing an umbrella.)
[Wikipedia](!Wikipedia "Value of information") says that for a risk-neutral person, value of perfect information is "value of decision situation with perfect information" - "value of current decision situation". (Imperfect information is just weakened perfect information: if your information was not 100% reliable but 99% reliable, well, that's worth 99% as much.)
The decision is the binary take or not take. Melatonin costs ~\$10 a year (if you buy in bulk during sales, as I did). Suppose I had perfect information it worked; I would not change anything, so the value is \$0. Suppose I had perfect information it did not work; then I would stop using it, saving me \$10 a year in perpetuity, which has a net present value[^NPV] (at 5% discounting) of \$205. So the best-case value of perfect information - the case in which it changes my actions - is \$205, because it would save me from blowing \$10 every year for the rest of my life. My melatonin experiment is not perfect since I didn't randomize or double-blind it, but I had a lot of data and it was well powered, with something like a >90% chance of detecting the decent effect size I expected, so the imperfection is just a loss of 10%, down to \$184. From my previous research and personal use over years, I am highly confident it works - say, 80%^[Vaniver notes that one reason I might be less confident than you would expect is that many substances or supplements lose effect over time as one's body regains homeostasis and compensates for the substance, building tolerance. Which is quite true, and a major reason I tested melatonin - I was sure it worked for me in the past, but did it *still* work?].
If the experiment says melatonin works, the information is useless to me since I continue using melatonin, and if the experiment says it doesn't, then let's assume I decide to quit melatonin[^quitting] and then save \$10 a year or \$184 total. What's the expected value of obtaining the information, giving these two outcomes? $(80% \times 0) + (20% \times 184) = 36.8$. Or another way, redoing the net present value: $\frac{10 - 0}{\ln 1.05} \times 0.9 \times 0.2$ At minimum wage opportunity cost of \$7 an hour, \$36.8 is worth 5.25 hours of my time. I spent much time on screenshots, summarizing, and analysis, and I'd guess I spent closer to 10-15 hours all told.
[^NPV]: The net present value formula is the annual savings divided by the natural log of the discount rate, out to eternity. Exponential discounting means that a bond that expires in 50 years is worth a surprisingly similar amount to one that continues paying out forever. For example, a 50 year bond paying \$10 a year at a discount rate of 5% is worth `sum (map (\t -> 10 / (1 + 0.05)^t) [1..50]) ~> 182.5` but if that same bond never expires, it's worth `10 / log 1.05 = 204.9` or just \$22.4 more! My own expected longevity is ~50 more years, but I prefer to use the simple natural log formula rather than the more accurate summation. Either way is interesting; [Vaniver](http://lesswrong.com/r/discussion/lw/cih/value_of_information_8_examples/6mns):
> ...possibly a way to drive it home is to talk about dividing by `log 1.05`, which is essentially multiplying by 20.5. If you can make a one-time investment that pays off annually until you die, that's worth 20.5 times the annual return, and multiplying the value of something by 20 can often move it from not worth thinking about to worth thinking about.
[^quitting]: For simplicity, in all my VoI calculations I assume that I'll stop buying the supplement (or doing the activity) if I hit a negative result. The *proper* way a real analyst would do this value of information question would be to say that the negative result gives us additional information which changes the expected-value of melatonin use.
In my [melatonin article](Melatonin#roi) article, I calculated that since melatonin saved me close to an hour while each dose cost literally a penny or two, the value was astronomical - \$2350.60 a year! By Bayes' formula, if I started with 80% confidence and had a 95% accurate test, a negative result drops my 80% all the way down to 17%. We get this by using [a derivation of Bayes's theorem](Modafinil#ordering-with-learning):
$P(a|b) = \frac{P(b|a) \times P(a)}{(P(b|a) \times P(a)) + (P(b|\lnot a) \times P(\lnot a))} = \frac{0.05 \times 0.8}{(0.05 \times 0.8) + (0.95 \times 0.2)} = 0.174$
But ironically if I now believed that melatonin only had a 17% chance of doing something helpful rather than nothing at all (as compared to my original 80% belief), well, 17% of \$2350 (\$117) is still way more money than the melatonin cost (\$10), so I'd use it *anyway*!
Would it make sense to iterate again and test melatonin a second time? Well, what does the calculation say? We have a new prior of 17; what happens if we get a negative result again? $\frac{0.05 \times 0.17}{(0.05 \times 0.17) + (0.95 \times 0.82)} = 0.01$ and then the expected value is $0.0107... \times 2350 = 25.7$, which is not much more than the cost of \$10, and given the difficult-to-quantify possibility of negative long-term health effects, is not enough of a profit to really entice me.
This worked out example demonstrates that when a substance is cheap and you are highly confident it works, a long costly experiment may not be worth it. (Of course, I would have done it anyway due to factors not included in the calculation: to try out my Zeo, learn a bit about sleep experimentation, do something cool, and have something neat to show everyone.)
## Melatonin data
The data looked much better than the first night, except for a big 2-hour gap where I vaguely recall the sensor headband having slipped off. (I don't think it was because it was uncomfortable but due to shifting positions or something.) Judging from the cycle of sleep phases, I think I lost data on a REM peak. The REM peaks interest me because it's a standard theory of polyphasic sleeping that thriving on 2 or 3 hours of sleep a day is possible because REM (and deep sleep) is the only phase that truly matters, and REM can dominate sleep time through [REM rebound](!Wikipedia) and training.
![Second night](/images/zeo/2010-12-26.png)
Besides that, I noticed that time to sleep was 19 minutes that night. I also had forgotten to take my melatonin. Hmm...
Since I've begun this inadvertent experiment, I'll try continuing it, alternating days of melatonin usage. I claim in my melatonin article that usage seems to save about 1 hour of sleep/time, but there's several possible avenues. One could be quicker to fall asleep; one could awake fewer times; and one could have greater percentage of REM or deep sleep, reducing light sleep. (Light sleep doesn't seem very useful; I sometimes feel worse after light sleep.)
During the afternoon, I took a quick nap. I'm not a very good napper, it seems - only the first 5 minutes registered as even light sleep.
A dose of melatonin (1.5mg) and off to bed a bit early. I'm a little more impressed with the smart alarm; since I'm hard-of-hearing and audio alarms rarely if ever work, I usually use a [Sonic Alert](http://www.amazon.com/Sonic-Alert-SBP100-Portable-Vibrating/dp/B000EX3DQQ) vibrating alarm clock. But in the morning I woke up within a minute of the alarm, despite the lack of vibration or flashing lights. (The chart doesn't reflect this, but as a previous link says, distinguishing waking from sleeping can be difficult and the transitions are the least trustworthy parts of the data.)
The data was especially good today, with no big gaps:
![](/images/zeo/2010-12-27.png)
You can see an impressively regular sleep cycle, cycling between REM and light sleep. What's disturbing is the relative lack of deep sleep - down 4-5% (and there wasn't a lot to begin with). I suspect that the lack of deep sleep indicates I wasn't sleeping very well, but not badly enough to wake up, and this is probably due either to light from the Zeo itself - I only figured out how to turn it off a few days later - or my lack of regular blankets and use of a sleeping bag. But the awakenings around 4-6 AM and on other days has made me suspicious that one of the cats is bothering me around here and I'm just forgetting it as I fall asleep.
The next night is another no-melatonin night. This time it took 79 minutes to fall asleep. Very bad, but far from unprecedented; this sort of thing is why I was interested in melatonin in the first place. Deep sleep is again limited in dispersion, with a block at the beginning and end, but mostly a regular cycle between light and REM:
![](/images/zeo/2010-12-28.png)
Melatonin night, and 32 minutes to sleep. (I'm starting to notice a trend here.) Another fairly regular cycle of phases, with some deep sleep at the beginning and end; 32 minutes to fall asleep isn't great but much better than 79 minutes.
![](/images/zeo/2010-12-29.png)
Perhaps I should try a biphasic schedule where I sleep for an hour at the beginning and end? That'd seem to pick up most of my deep sleep, and REM would hopefully take care of itself with REM rebound. Need to sum my average REM & deep sleep times (that sum seems to differ quite a bit, eg one fellow needs [4+ hours](http://web.archive.org/web/20130108020156/http://www.myzeo.com/sleep/comment/1131#comment-1131). My own need seems to be similar) so I don't try to pick a schedule doomed to fail.
Another night, no melatonin. Time to sleep, just 18 minutes and the ZQ sets a new record even though my cat Stormy woke me up in the morning^[_Technology Review_ editor Emily Singer [noticed the same problem](http://www.technologyreview.com/blog/themeasuredlife/26894/) when using her Zeo.]:
![](/images/zeo/2010-12-30.png)
I personally blame this on being exhausted from 10 hours working on my transcription of [_The Notenki Memoirs_](/docs/2002-notenki-memoirs). But a data point is a data point.
I spend New Year's Eve pretty much finishing _The Notenki Memoirs_ (transcribing the last of the biographies, the round-table discussion, and editing the images for inclusion), which exhausts me a fair bit as well; the champagne doesn't help, but between that and the melatonin, I fall asleep in a record-setting 7 minutes. Unfortunately, the headband came off somewhere around 5 AM:
![](/images/zeo/2010-12-31.png)
A cat? Waking up? Dunno.
Another relatively quick falling asleep night at 20 minutes. Which then gets screwed up as I simply can't stay asleep and then the cat begins bothering the heck out of me in the early morning:
![](/images/zeo/2011-01-01.png)
Melatonin night, which subjectively didn't go too badly; 20 minutes to sleep. But lots of wake time (long enough wakes that I remembered them) and 2 or 3 hours not recorded (probably from adjusting my scarf and the headband):
![](/images/zeo/2011-01-03.png)
Accidentally did another melatonin night (thought Monday was a no-melatonin night). Very good sleep - set records for REM especially towards the late morning which is curious. (The dreams were also very curious. I was an Evangelion character (Kaworu) tasked with riding that kind of carnival-like ride that goes up and drops straight down.) Also another quick falling asleep:
![](/images/zeo/2011-01-04.png)
Rather than 3 melatonin nights in a row, I skipped melatonin this night (and thus will have it the next one). Perhaps because I went to sleep so very late, and despite some awakenings, this was a record-setting night for ZQ and TODO deep sleep or REM sleep? :
![](/images/zeo/2011-01-05.png)
I also switched the alarm sounds 2 or 3 days ago to 'forest' sounds; they seem somewhat more pleasant than the beeping musical tones. The next night, data is all screwed up. What happened there? It didn't even record the start of the night, though it seemed to be active and working when I checked right before going to sleep. Odd.
Next 2 days aren't very interesting; first is no-melatonin, second is melatonin:
![](/images/zeo/2011-01-07.png)
![](/images/zeo/2011-01-08.png)
![Off](/images/zeo/2011-01-09.png)
![On](/images/zeo/2011-01-10.png)
![Off](/images/zeo/2011-01-11.png)
One of my chief Zeo complaints was the bright blue-white LCD screen. I had resorted to turning the base station over and surrounding it with socks to block the light. Then I looked closer at the labels for the buttons and learned that the up-down buttons changed the brightness and the LCD screen could be turned off. And I had read the part of the manual that explained that. D'oh!
![On](/images/zeo/2011-01-12.png)
![?](/images/zeo/2011-01-13.png)
![Off](/images/zeo/2011-01-14.png)
![Off (forgot)](/images/zeo/2011-01-15.png)
![On](/images/zeo/2011-01-16.png)
![Off](/images/zeo/2011-01-17.png)
![On](/images/zeo/2011-01-18.png)
![Off](/images/zeo/2011-01-19.png)
![On](/images/zeo/2011-01-20.png)
![Off](/images/zeo/2011-01-21.png)
Off, but no data on the 22nd. No idea what the problem is - the headset seems to have been on all night.
On with a double-dose of melatonin because I was going to bed early; as you can see, didn't work:
![](/images/zeo/2011-01-23.png)
Off, no data on the 24th. On, no data on the 25th. I don't know what went wrong on these two nights.
![Off](/images/zeo/2011-01-26.png)
The 27th (on for melatonin) yielded no data because, frustratingly, the Zeo was printing a 'write-protected' error on its screen; I assumed it had something to do with uploading earlier that day - perhaps I had yanked it out too quickly - and put it back in the computer, unmounted and went to eject it. But the memory card splintered on me! It was stuck and the end was splintering and little needles of plastic breaking off. I couldn't get it out and gave up. The next day (I slept reasonably well) I went back with a pair of needle-nose pliers. I had a backup memory card. After much trial and error, I figured out the card had to be FAT-formatted and have a directory structure that looked like `ZEO/ZEOSLEEP.DAT`. So that's that.
- ![Off](/images/zeo/2011-01-28.png)
- ![On](/images/zeo/2011-01-29.png)
- 30: on
- 31: off
- 1: on
- 2: off
- 3: on
Unfortunately, this night continues a long run of no data. Looking back, it doesn't *seem* to have been the fault of the new memory card, since some nights did have enough data for the Zeo website to generate graphs. I suspect that the issue is the pad getting dirty after more than a month of use. I hope so, anyway. I'll look around for rubbing alcohol to clean it. That night initially starts badly - the rubbing alcohol seemed to do nothing. After some messing around, I figure out that the headband seems to have loosened over the weeks and so while the sensor felt reasonably snug and tight and was transmitting, it wasn't snug enough. I tighten it considerably and actually get some decent data:
- ![Off](/images/zeo/2011-02-04.png)
- 5: on
- ![Off](/images/zeo/2011-02-06.png)
- 7: on
- 8: off
- 9: on
- ![Off](/images/zeo/2011-02-10.png)
- 11: on?
The previous night, I began paying closer attention to when it was and was not reading me (usually the latter). Pushing hard on it made it eventually read me, but tightening the headband hadn't helped the previous several nights. Pushing and not pushing, I noticed a subtle click. Apparently the band part with the metal sensor pad connects to the wireless unit by 3 little black metal nubs; 2 were solidly in place, but the third was completely loose. Suspicious, I try pulling on the band *without* pushing on the wireless unit - leaving the loose connection loose. Sure enough, no connection was registered. I push on the unit while loosing the headband - and the connection worked. I felt I finally had solved it. It wasn't a loose headband or me pulling it off at night or oils on the metal sensors or a problem with the SD card. I was too tired to fix it when I had the realization, but resolved the next morning to fix it by wrapping a rubber band around the wireless unit and band. This turned out to not interfere with recharging, and when I took a short nap, the data looked fine and gapless. So! The long data drought is hopefully over.
![](/images/zeo/2011-02-11.png)
![Off](/images/zeo/2011-02-12.png)
![On](/images/zeo/2011-02-13.png)
![Off](/images/zeo/2011-02-14.png)
On the 15th of February, I had a very early flight to San Francisco. That night and every night from then on, I was using melatonin, so we'll just include all the nights for which any sensible data was gathered. Oddly enough, the data and ZQs seem bad (as one would expect from sleeping on a couch), but I wake up feeling fairly refreshed. By this point we have the idea how the sleep charts work, so I will simply link them rather than display them.
- [02-15](/images/zeo/2011-02-15.png)
- [02-16](/images/zeo/2011-02-16.png)
- [02-17](/images/zeo/2011-02-17.png)
- [02-18](/images/zeo/2011-02-18.png)
- [02-19](/images/zeo/2011-02-19.png)
- [02-20](/images/zeo/2011-02-20.png)
Then I took a long break on updating this page; when I had a month or two of data, I uploaded to Zeo again, and buckled down and figured out how to have [ImageMagick](!Wikipedia) [crop](http://www.imagemagick.org/Usage/crop/#crop) pages. The shell script (for screenshots of my browser, YMMV) is `for file in *.png; do mogrify +repage -crop 700x350+350+285 $file; done;`
General observations: almost all these nights were on melatonin. Not far into this period, I realized that the little rubber band was not working, and I hauled out my red [electrical tape](!Wikipedia) and tightened it but good; and again, you can see the transition from crappy recordings to much cleaner recordings. The rest of February:
- [02-23](/images/zeo/2011-02-23.png)
- [02-24](/images/zeo/2011-02-24.png)
- [02-26](/images/zeo/2011-02-26.png)
- [02-28](/images/zeo/2011-02-28.png)
March:
- [03-01](/images/zeo/2011-03-01.png) / [03-02](/images/zeo/2011-03-02.png)
- [03-05](/images/zeo/2011-03-05.png) / [03-07](/images/zeo/2011-03-07.png)
- [03-08](/images/zeo/2011-03-08.png) / [03-09](/images/zeo/2011-03-09.png)
- [03-10](/images/zeo/2011-03-10.png) / [03-11](/images/zeo/2011-03-11.png)
- [03-15](/images/zeo/2011-03-15.png) / [03-19](/images/zeo/2011-03-19.png)
- [03-22](/images/zeo/2011-03-22.png) / [03-23](/images/zeo/2011-03-23.png)
- [03-24](/images/zeo/2011-03-24.png) / [03-25](/images/zeo/2011-03-25.png)
- [03-26](/images/zeo/2011-03-26.png) / [03-27](/images/zeo/2011-03-27.png)
- [03-28](/images/zeo/2011-03-28.png) / [03-29](/images/zeo/2011-03-29.png)
- [03-30](/images/zeo/2011-03-30.png) / [03-31](/images/zeo/2011-03-31.png)
April:
- [04-01](/images/zeo/2011-04-01.png)
- [04-02](/images/zeo/2011-04-02.png)
- [04-03](/images/zeo/2011-04-03.png)
- [04-04](/images/zeo/2011-04-04.png)
April 4th was one of the few nights that I was not on melatonin during this timespan; I occasionally take a weekend and try to drop all supplements and nootropics besides the multivitamins and fish oil, which includes my melatonin pills. This night (or more precisely, that Sunday evening) I also stayed up late working on my computer, getting in to bed at 12:25 AM. You can see how well that worked out. During the 2 AM wake period, it occurred to me that I didn't especially want to sacrifice a day to show that computer work can make for bad sleep (which I already have plenty of citations for in [the Melatonin essay](Melatonin#health-performance)), and I gave in, taking a pill. That worked out much better, with a relatively normal number of wakings after 2 AM and a reasonable amount of deep & REM sleep.
- [04-05](/images/zeo/2011-04-05.png) / [04-06](/images/zeo/2011-04-06.png)
- [04-07](/images/zeo/2011-04-07.png) / [04-08](/images/zeo/2011-04-08.png)
- [04-09](/images/zeo/2011-04-09.png) / [04-10](/images/zeo/2011-04-10.png) / [2011-04-11](/images/zeo/2011-04-11.png)
- [04-12 off](/images/zeo/2011-04-12.png) / [04-13 on](/images/zeo/2011-04-13.png)
- [04-14 on](/images/zeo/2011-04-14.png) / [04-15 on](/images/zeo/2011-04-15.png)
- [04-16 on](/images/zeo/2011-04-16.png) / [04-18 off](/images/zeo/2011-04-18.png)
- [04-20 off](/images/zeo/2011-04-20.png) / [04-22 on](/images/zeo/2011-04-22.png)
- [04-23 off](/images/zeo/2011-04-23.png) / [04-24 on](/images/zeo/2011-04-24.png)
- [04-26 on](/images/zeo/2011-04-26.png) / [04-27 off](/images/zeo/2011-04-27.png)
- [05-03 off](/images/zeo/2011-05-03.png) / [05-06 on](/images/zeo/2011-05-06.png)
- [05-07 off](/images/zeo/2011-05-07.png) / [05-08 on](/images/zeo/2011-05-08.png)
# Exercise
## One-legged standing
Seth Roberts found that for him, standing a lot [helped him sleep](http://escholarship.org/uc/item/2xc2h866). This seems very plausible to me - more fatigue to repair, closer to ancestral conditions of constant walking - and tallied with my own experience. (One summer I worked at Yawgoog Scout Camp, where I spent the entire day on my feet; I always slept very well though my bunk was uncomfortable.) He also found that stressing his legs by standing on one at a time for a few minutes also [helped him sleep](http://blog.sethroberts.net/2011/03/22/effect-of-one-legged-standing-on-sleep/). That did not seem as plausible to me. But still worth trying: standing is free, and if it does nothing, at least I got a little more exercise.
Roberts tried a fairly complicated randomized routine. I am simply alternating days as with melatonin (note that I have resumed taking melatonin every day). My standing method is also simple; for 5 minutes, I stand on one leg, rise up onto the ball of my foot (because my calves are in good shape), and then sink down a foot or two and hold it until the burning sensation in my thigh forces me to switch to the other leg. (I seem to alternate every minute.) I walk my dog most every day, so the effect is not as simple as 'some moderate exercise that day'; in the next experiment, I might try 5 minutes of dumbbell bicep curves instead.
### One-legged standing analysis
The initial results were promising. Of the first 5 days, 3 are 'on' and 2 are off; all 3 on-days had higher ZQs than the 2 off-days. Unfortunately, the full time series did not seem to bear this out. Looking at the ~70 recorded days between 11 June 2011 and 27 August 2011 ([raw CSV data](/docs/zeo/2011-zeo-oneleg.csv)), the raw uncorrected averages looked like this (as before, the '3' means the intervention was used, '0' that it was not):
![Standing ZQ vs non-standing](/images/zeo/2011-oneleg-zq.png)
![Morning feel rating](/images/zeo/2011-oneleg-morningfeel.png)
![Total sleep time](/images/zeo/2011-oneleg-totalz.png)
![Total deep sleep time](/images/zeo/2011-oneleg-deep.png)
![Total REM sleep time](/images/zeo/2011-oneleg-rem.png)
![Number of times woken](/images/zeo/2011-oneleg-woken.png)
![Total time awake](/images/zeo/2011-oneleg-wake.png)
R analysis, using multivariate linear regression[^R-oneleg-analysis] turns in a non-significant value for one-leggedness in general (_p_=0.23); by variable:
Variable Effect _p_-value Coefficient's sign is...
------------ ---------------- ----------- -------------------------
`ZQ` -1.24 0.16 worse
`Total.Z` -4.09 0.37 worse
`Time.to.Z` 0.47 0.51 worse
`Time.in.Wake` -0.37 0.80 better
`Time.in.REM` -5.33 0.02 worse
`Time.in.Light` 2.76 0.38 worse
`Time.in.Deep` -1.56 0.10 worse
`Awakenings` -0.05 0.79 better
`Morning.Feel` -0.05 0.32 worse
No _p_-values survived multiple-correction[^leg-multiple-correction]:.
[^R-oneleg-analysis]: The `R` interpreter session, loading a CSV as before:
~~~{.R}
R> zeo <- read.csv("http://www.gwern.net/docs/zeo/2011-zeo-oneleg.csv")
R> colnames(zeo)[24] <- "OneLeg"
R> l <- lm(cbind(ZQ, Total.Z, Time.to.Z, Time.in.Wake, Time.in.REM,
Time.in.Light, Time.in.Deep, Awakenings, Morning.Feel)
~ OneLeg, data=zeo)
R> summary(manova(l))
Df Pillai approx F num Df den Df Pr(>F)
OneLeg 1 0.177 1.37 9 57 0.23
Residuals 65
R> summary(l)
Response ZQ :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 96.231 1.712 56.22 <2e-16
OneLeg -1.244 0.883 -1.41 0.16
Response Total.Z :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 514.67 8.84 58.2 <2e-16
OneLeg -4.09 4.56 -0.9 0.37
Response Time.to.Z :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 14.949 1.373 10.89 2.7e-16
OneLeg 0.469 0.708 0.66 0.51
Response Time.in.Wake :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 12.821 2.786 4.60 2e-05
OneLeg -0.369 1.436 -0.26 0.8
Response Time.in.REM :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 168.72 4.25 39.70 <2e-16
OneLeg -5.33 2.19 -2.43 0.018
Response Time.in.Light :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 277.15 6.06 45.75 <2e-16
OneLeg 2.76 3.12 0.88 0.38
Response Time.in.Deep :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 69.282 1.802 38.44 <2e-16
OneLeg -1.558 0.929 -1.68 0.098
Response Awakenings :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.1538 0.3690 11.26 <2e-16
OneLeg -0.0513 0.1902 -0.27 0.79
Response Morning.Feel :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.8718 0.1014 28.3 <2e-16
OneLeg -0.0525 0.0523 -1.0 0.32
~~~
[^leg-multiple-correction]: If we correct for multiple comparisons (see [previous footnote](#fn7) on the Bonferroni correction) at _q_-value=0.05, none of them survive:
~~~{.R}
R> p.adjust(c(0.16,0.37,0.51,0.80,0.02,0.38,0.10,0.79,0.32), method="BH") < 0.05
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
~~~
Oh well! Statistics is a harsh mistress indeed.
While I did not replicate Roberts's setup exactly in the interest of time and ease, and obviously it was not blinded, I tried to compensate with an unusually large sample: 69 nights of data. This was a mixed experiment: there seems to be an negative effect, but none of the changes seem to have large effect sizes or strong _p_-values.
The one-legged standing was not in exclusion to melatonin use, but I had used it most every night. I thought I might go on using one-legged standing, perhaps skipping it on nights when I am up particularly late or lack the willpower, but I've abandoned it because it is a lot of work to use and the result looked weak. In the future, I should look into whether walks before bedtime help.
# Vitamin D
## Background
[Seth Roberts has speculated](http://blog.sethroberts.net/category/sleep/vitamin-d3-and-sleep/) that [vitamin D](!Wikipedia), despite its myriads of [other benefits](Nootropics#vitamin-d), may harm sleep when taken in the evening and help sleep when taken in the morning based on some anecdotes (with [2 null results](http://blog.sethroberts.net/2012/02/03/vitamin-d3-and-sleep-story-11/)). The anecdotes are nearly worthless as sleep is pretty variable (look above or below, and you'll see swings of over 20 ZQ points night to night), and just a little carelessness or selection bias will persuade one that there is a major effect where there is none - especially since they are not using Zeos or accelerometers or even giving basic quantities like 'I felt bad in the morning 3/5 days'. But I began to wonder. Vitamin D is a chemical intimately involved in circadian rhythms (a '[zeitgeber](!Wikipedia)'), with some connections to systems involved in sleep (["The steroid hormone of sunlight soltriol (vitamin D) as a seasonal regulator of biological activities and photoperiodic rhythms"](http://www.unc.edu/~stumpfwe/steroid-hormone-of-sunlight-soltriol.pdf)); given its links to the *early* day and sunlight, one would expect it to affect sleep for the worse.
To see what, if any existing research there was, I checked the 49 hits in [PubMed](!Wikipedia) and the first 10 pages of [Google Scholar](!Wikipedia) for '"vitamin D" sleep'. For the most part, hits were completely irrelevant, and the most relevant ones like ["Vitamins and Sleep: An Exploratory Study"](http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2174691/) did not cover any relationship between vitamin D and sleep, much less the *timing* of vitamin D consumption. There's some speculation the elderly may sleep badly in part due to lack of vitamin D (["Some new food for thought: The role of vitamin D in the mental health of older adults "](http://www.springerlink.com/content/g735r77159xq3550/)), but the only hard results I found were weak or tangential: a correlation with daytime sleepiness in Taiwanese dialysis patients[^Taiwan], a correlation with later sleep in American women[^America], a correlation with earlier sleep in Japanese women[^Japan], a correlation with [reduced sleep difficulties in Americans](/docs/zeo/2013-grandner.pdf "'Sleep symptoms associated with intake of specific dietary nutrients', Grandner et al 2013"), and a correlation of blood levels with both better and worse sleep in Americans[^Shiue]. This reads like noise.
[^Shiue]: ["Low vitamin D levels in adults with longer time to fall asleep: US NHANES, 2005-2006"](/docs/zeo/2013-shiue.pdf), Shiue 2013:
> ...Table 2 shows associations of serum 25(OH)D concentrations and sleep characteristics. After adjusting for age, sex, ethnicity, high blood pressure, body mass index, active smoking, depressive symptoms, and survey weighting, no association between serum 25(OH)D concentrations and sleeping hours was observed (beta 0.19, 95% CI −0.40 0.77, _p_ = 0.51) while a significant inverse association was found between serum 25(OH)D concentrations and minutes to fall asleep (beta −3.13, 95% CI −5.62 to −0.64, _p_ = 0.02). Moreover, people with higher vitamin D levels could be more likely to complain sleep problems (OR 1.60, 95% CI 1.20 to 2.14, _p_ = 0.004)....It was observed that serum 25(OH)D concentrations were significantly associated with minutes to fall asleep, indicating that people with lower vitamin D levels tended to have longer time to fall asleep. On the other hand, it was also observed that people with higher vitamin D levels had more sleep complaints, although the reason is unclear.
[^Taiwan]: ["Sleep Behavior Disorders in a Large Cohort of Chinese (Taiwanese) Patients Maintained by Long-Term Hemodialysis"](http://www.realfoodnutrients.com/Sleep/Studies/SleepBehaviorDisordersandVitaminD.pdf) (Chen et al 2006):
> ...The increased odds of high PSQI score for greater hemoglobin level and for high ESS score for use of vitamin D analogues were unexpected results for which we cannot speculate about the cause or association and that may simply be spurious findings arising from statistical analysis.
[^America]: ["Relationships among dietary nutrients and subjective sleep, objective sleep, and napping in women"](http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2819566/) (Grandner et al 2010):
> This study found a [statistically-]significant relationship between circadian phase of sleep and dietary Vitamin D intake. Later sleep acrophase, an indicator of sleep timing, was associated with more dietary Vitamin D. For most people, most Vitamin D is obtained through sunlight(44), though dietary Vitamin D is usually obtained through supplementation, usually in pills or in dairy products(44). It is currently unknown why those who consumed more Vitamin D would demonstrate a sleep phase delay, especially since in this same subject group, those exposed to more light had earlier circadian acrophases(45).
[^Japan]: ["The midpoint of sleep is associated with dietary intake and dietary behavior among young Japanese women"](/docs/zeo/2011-sato-mito.pdf) (Sato-Mito et al 2011):
> Late midpoint of sleep was [statistically-]significantly negatively associated with the percentage of energy from protein and carbohydrates, and the energy-adjusted intake of cholesterol, potassium, calcium, magnesium, iron, zinc, vitamin A, vitamin D, thiamin, riboflavin, vitamin B(6), folate, rice, vegetables, pulses, eggs, and milk and milk products.
In June 2012, after I finished my 2 experiments, a preprint appeared for _Medical Hypotheses_: ["The world epidemic of sleep disorders is linked to vitamin D deficiency"](/docs/zeo/2012-gominak.pdf), Gominak & Stumpf 2012; the lead author, unfortunately, had little to tell me when I emailed her, indicating that the use of vitamin D was not systematic or recorded:
> An observation of sleep improvement with vitamin D supplementation led to a 2 year uncontrolled trial of vitamin D supplementation in 1500 patients with neurologic complaints who also had evidence of abnormal sleep. Most patients had improvement in neurologic symptoms and sleep but only through maintaining a narrow range of 25(OH) vitamin D3 blood levels of 60-80 ng/ml. Comparisons of brain regions associated with sleep-wake regulation and vitamin D target neurons in the diencephalon and several brainstem nuclei suggest direct central effects of vitamin D on sleep...An uncontrolled trial of continuous positive airway pressure CPAP devices for patients with headache and obstructive sleep apnea was partially successful, but in the fall of 2009 two patients remarked that the serendipitous supplementation of vitamin D, in addition to the use of their CPAP devices had, over a period of weeks, allowed them to wake rested and without headaches. Because the majority of the daily headache sufferers also had vitamin D deficiency the same author went looking for a possible connection between vitamin D and paralysis during sleep. This led to the recognition that several nuclei in the hypothalamus and brainstem that are known to be involved in sleep have high concentrations of vitamin D receptors^15,16,17^. An uncontrolled clinical trial of vitamin D supplementation in 1500 patients over a 2 year period, maintaining a consistent vitamin D blood level in the range of 60-80 ng/ml over many months, produced normal sleep in most patients regardless of the type of sleep disorder, suggesting that multiple types of sleep disorders might share the same etiology...Like other steroid hormones, Vitamin D is thought to exert its effects in the nucleus of the cell, at the vitamin D receptor, promoting transcription of specific genes. There are also reports of actions unrelated to transcription, possibly mediated by surface membrane receptors, such as Ca++ channels, that produce cellular effects in minutes^5^. Surprisingly, doses of 20,000 IU/day promote normal sleep without being sedating, and the effect is apparent within the first day of dosing in patients who have had severe sleep disruption and very low 25(OH) vitamin D3 levels...Many of the ideas about normal sleep expressed here grew out of watching patients return to normal sleep cycles, over a period of months, with just the return of the 25(OH) vitamin D3 blood level to 60-80 ng/ml. A totally unexpected observation was that the sleep difficulties produced by vitamin D levels below 50 return, in the same form, as the level goes over 80 ng/ml suggesting a narrower range of "normal" vitamin D levels for sleep than those published for bone health. Also, Vitamin D2, ergocalciferol (widely recommended as an "equivalent" therapy for osteoporosis) prevented normal sleep in most patients, suggesting that D2 may be close enough in structure to act as a partial agonist at some locations, an antagonist at others.
Comments:
- I don't know about the overarching claims (I suspect most of the problem is [lighting](Melatonin#health-performance), and general demands on time), but the trial itself seems really important, especially since neither Roberts nor I had the slightest idea about it but seem to have reached similar results
- the 2 patients suggested it, in an interesting example of the value of self-experimentation
- the authors cover much more specific potential connections between vitamin D and sleep than just "circadian rhythms"
- the methodology section is non-existent; how were these 1500 patients picked? how long did each use vitamin D? Unfortunately, I nor Roberts has taken vitamin D blood tests (as far as I know) and so we cannot verify that the authors' 60-80ng/ml range is what we fell into, but it's plausible. How is sleep quality being measured? Are these results consistent or inconsistent with the one case of morning mood/restedness improvement but little else? Although even if they were inconsistent, that could be explained by neither of us being sleep disorder sufferers and the effect being weaker in us
In July 2012, preprints of [Huang et al 2012](/docs/zeo/2012-huang.pdf "Improvement of Pain, Sleep, and Quality of Life in Chronic Pain Patients With Vitamin D Supplementation") became available; it is a [case series](!Wikipedia) - the authors followed a group of veterans with chronic pain who received vitamin D supplements, finding improvements to pain but also reduction in sleep latency and increase in sleep duration. While I did not observe any effect on latency or duration in my following experiments, this would still be a promising datapoint but unfortunately, the sample had substantial dropout, and had no control group (hence no randomizing or blinding). This renders the study not very useful - the improvements being perhaps just [regression toward the mean](!Wikipedia) or a [selection bias](!Wikipedia). In 2013, a review ([McCarty et al 2013](http://andrewamarino.com/PDFs/173-SleepMedRev2013.pdf "The link between vitamin D metabolism and sleep medicine")) came out arguing that "low vitamin D levels increase the risk for autoimmune disease, chronic rhinitis, tonsillar hypertrophy, cardiovascular disease, and diabetes. These conditions are mediated by altered immunomodulation, increased propensity to infection, and increased levels of inflammatory substances, including those that regulate sleep"; this might handle negative effects on sleep from chronically low vitamin D, but doesn't seem relevant to acute effects varying by time of administration.
Blogger Chris L [looked back in August 2012](http://evenbetterchris.blogspot.com/2012/08/vitamin-d-destroyed-my-deep-sleep.html "Vitamin D destroyed my deep sleep") on ~1 year of Zeo data and a quasi-experiment in which he started with 4000IU of vitamin D supplementation, then 5000IU, then none; he took them at night, then switched to morning; the results were that the length of his deep sleep started high, dropped, and then recovered. He interprets this as evidence that too much vitamin D hurts sleep.
## Vitamin D at night hurts?
### Setup
I decided to run a small double-blind experiment much like the [Adderall](Nootropics#adderall-blind-testing) and other trials. My Vitamin D is 360 5000IU softgels by 'Healthy Origins', bought on `iHerb.com`. The gel-capsules contain [cholecalciferol](!Wikipedia) dissolved in olive oil. This made preparing placebo pills a little more difficult. I wound up puncturing the capsules, squeezing out the olive oil contents into a new capsule (they were too wide to push in) and then pushing in the empty shell; all 20 were topped off with ordinary white baking flour. (I used up the last of my creatine preparing the placebos for the [Modalert day trial](Nootropics#modalert-blind-day-trial).) For the 20 placebo pills, I spooned in some olive oil to each and topped them off with flour as well. Each set went into its own identical Tupperware container. The process was a little messier than I had hoped, but the pills seem like they will work.
The procedure at night will be: in the dark^[The problem was the original vitamin D3 capsule: I couldn't squeeze out *all* the oil, so I settled for squeezing out most, and then pushing the original capsule into the new capsule. So they contain everything they should, but they have a visible 'bubble' inside them (the original capsule). Hence, the need for literal blinding. Otherwise, they're pretty good: identical shape and weight.] immediately before putting on the Zeo headband and going to bed, I will take my usual melatonin pill; then I will take the two containers blindly; mix them up; select a pill from one to take, and put the selected container on the shelf next to the Zeo. In the morning, I will see which one I took. (The Vitamin D olive oil was distinctly more yellow than the green placebo olive oil.) If I took placebo, I will take my usual daily dose of Vitamin D, and if active, I will skip it. This hopefully will blind me and keep constant my total Vitamin D intake. (This procedure may need to be amended with something more like the modafinil/Adderall procedure: a bag with replacement of the consumed placebos.) If I get a run of one kind of pills, I will re-balance the numbers.
Based on the first 10 days' ZQs, I predict I'll find in the final data set:
1. increased sleep latency; probably at least another 10 minutes to fall asleep, as my mind seems to churn away with ideas of things to do
2. increased awakenings; not that many, maybe 1 or 2 on average
3. decreased ZQ; by around 5-10 points (a large effect, on par with melatonin)
My best guess is that the ZQ hit is coming from reduced deep sleep, or maybe reduced deep & REM sleep. I don't think the total amount of sleep has changed.
Roberts theorizes that besides vitamin D damaging sleep, it could actively improve your sleep if taken in the morning. As it happens, in this setup, on 'placebo' days I do take vitamin D in the morning - so wouldn't one expect to see scores improve on the nights following a placebo night (a vitamin D morning), regardless of whether *that* night was vitamin D or placebo? A quick analysis of the first 24 nights showed the lagged nights to average a ZQ of 94.5. My monthly averages for October and November were 96, so there is no obvious improvement here.
One thing I suspect but cannot confirm - since I do not have a heart rate monitor - is that ~10 minutes after taking the vitamin D pills, my heart rate increases. Not to any uncomfortable or worrisome degree, but when one expects one's heart rate to go down after going to bed, even a small increase in the opposite direction is noticeable. On the 12th, I finally got around to writing down this impression; then I searched online a bit and found that low vitamin D levels are associated with arrhythmia and other issues, but so are very high levels, and increased heart rates in the studies and anecdotes are associated with higher heart rates^[See the general remarks in [LiveStrong](http://www.livestrong.com/article/448585-vitamin-d-deficiency-heart-rate/), ["Vitamin D warning: Too much can harm your heart"](http://www.msnbc.msn.com/id/45325473/ns/health-diet_and_nutrition/t/vitamin-d-warning-too-much-can-harm-your-heart/), and the 2009 study ["Relation of serum 25-hydroxyvitamin D to heart rate and cardiac work (from the National Health and Nutrition Examination Surveys)"](/docs/zeo/2010-scragg.pdf "Scragg et al 2010").]. I'm not worried about the heart rate, but I am concerned that this is defeating the double-blinding: if all I have to do is notice my heart rate (and lying swaddled in bed in complete silence, it would be hard for me *not* to), then I've unblinded myself *before* falling asleep. Other stimulants like caffeine or sulbutiamine might similarly increase my heart rate, but they'd obviously also interfere with sleep, so I can't create any 'active placebo' even if I wanted to start over. (One promising future gadget is the ["Basis" wristwatch](http://mybasis.com/) which measures, among other things, heart-rate; I look forward to the early reviews.)
### Vitamin D data
The data ([trimmed CSV](/docs/zeo/2012-zeo-vitamind.csv)), covering January-February 2012:
Date Pill Quality[^q] ZQ Guess
---- ---- ------- --- -----
31D-1J active bad 84 [right 70%](http://predictionbook.com/predictions/5056)
1-2 placebo better 93 [right 65%](http://predictionbook.com/predictions/5096)
2-3 active well 94 [50%](http://predictionbook.com/predictions/5129)
3-4 active poor 86 [right 60%](http://predictionbook.com/predictions/5162)
4-5 placebo well 98 [wrong 60%](http://predictionbook.com/predictions/5179)
5-6 active mediocre 86 [50%](http://predictionbook.com/predictions/5195)
6-7 placebo OK ??[^e] [right 65%](http://predictionbook.com/predictions/5222)
7-8 placebo good 90 [right 60%](http://predictionbook.com/predictions/5238)
8-9 active poor 84 [right 65%](http://predictionbook.com/predictions/5270)
9-10 placebo good 95 [right 65%](http://predictionbook.com/predictions/5290)
10-11 active good 100 [wrong 70%](http://predictionbook.com/predictions/5311)
11-12 active mediocre 92 [right 70%](http://predictionbook.com/predictions/5318)
12-13 active mediocre 88 [50%](http://predictionbook.com/predictions/5325)
13-14 active poor 100 [right 60%](http://predictionbook.com/predictions/5361)
14-15 placebo poor 83 [wrong 60%](http://predictionbook.com/predictions/5375)
15-16 active poor 101 [right 55%](http://predictionbook.com/predictions/5384)
16-17 placebo mediocre 90 [50%](http://predictionbook.com/predictions/5391)
17-18 placebo mediocre 88 [right 60%](http://predictionbook.com/predictions/5400)
18-19 placebo good 100 [50%](http://predictionbook.com/predictions/5402)
19-20 active poor 86 [50%](http://predictionbook.com/predictions/5411)
20-21 active mediocre 85 [50%](http://predictionbook.com/predictions/5416)
21-22 placebo OK 91 [right 60%](http://predictionbook.com/predictions/5426)
22-23 placebo OK 106 [right 65%](http://predictionbook.com/predictions/5458)
23-24 active poor 91 [right 65%](http://predictionbook.com/predictions/5492)
24-25 active 1 79 [right 75%](http://predictionbook.com/predictions/5503)
25-26 placebo 3 85 [right 65%](http://predictionbook.com/predictions/5516)
26-27 active 2 ??[^e] [right 55%](http://predictionbook.com/predictions/5528)
28-29 active 3 85 [50%](http://predictionbook.com/predictions/5553)
29-30 active 3 93 [wrong 55%](http://predictionbook.com/predictions/5568)
30-31 placebo 3 100 [right 60%](http://predictionbook.com/predictions/5591)
31J-1F active 3 94 [50%](http://predictionbook.com/predictions/5607)
1F-2F active 2 89 [right 60%](http://predictionbook.com/predictions/5617)
2-3 active 1 83 [right 70%](http://predictionbook.com/predictions/5648)
3-4 placebo 2 81 [wrong 70%](http://predictionbook.com/predictions/5671)
5-6 placebo 3 98 [right 65%](http://predictionbook.com/predictions/5698)
6-7 active 2 88 [50%](http://predictionbook.com/predictions/5707)
7-8 active 2 94 [right 55%](http://predictionbook.com/predictions/5737)
8-9 active 3 94 [wrong 75%](http://predictionbook.com/predictions/5745)
9-10 placebo 3 92 [50%](http://predictionbook.com/predictions/5760)
10-11 placebo 3 95 [right 60%](http://predictionbook.com/predictions/5770)
11-12 placebo 3 103 [right 75%](http://predictionbook.com/predictions/5775)
12-13 placebo 3 84 [right 70%](http://predictionbook.com/predictions/5780)
[^e]: Headband came loose at some point, data useless
[^q]: For 'Quality' & 'ZQ': higher = better
(Data input was for 'Other Disruptions 3'; 0 = placebo, 1 = vitamin D.)
### Vitamin D analysis
From a quick look at the prediction confidences, I was usually correct but perhaps underconfident: my [proper scoring](!Wikipedia) log score compared to a random guesser is 5.4[^D-evening-predictions], which is even better than my guesses in my [Adderall experiment](Nootropics#results).
[^D-evening-predictions]: The preponderance of `True` is because while recording the scores, I normalized them; in retrospect, I shouldn't've bothered:
~~~{.haskell}
logBinaryScore = sum . map (\(result,p) -> if result then 1 + logBase 2 p else 1 + logBase 2 (1-p))
logBinaryScore [(True,0.50),(True,0.50),(True,0.50),(True,0.50),(True,0.50),(True,0.50),(True,0.50),
(True,0.50),(True,0.50),(True,0.50),(True,0.50),(True,0.55),(True,0.55),(True,0.55),
(True,0.60),(True,0.60),(True,0.60),(True,0.60),(True,0.60),(True,0.60),(True,0.60),
(True,0.60),(True,0.65),(True,0.65),(True,0.65),(True,0.65),(True,0.65),(True,0.65),
(True,0.65),(True,0.65),(True,0.70),(True,0.70),(True,0.70),(True,0.70),(True,0.75),
(True,0.75),(False,0.55),(False,0.6),(False,0.6),(False,0.7),(False,0.7),(False,0.75)]
5.4
~~~
Looking at the data averages in the Zeo website, it looked like ZQ & total & REM sleep fell, deep increased slightly, time awake & awakenings both increased, and morning feel decreased. The R analysis[^vitamin-D-analysis]:
[^vitamin-D-analysis]: The usual session:
~~~{.R}
R> zeo <- read.csv("http://www.gwern.net/docs/zeo/2012-zeo-vitamind.csv")
R> colnames(zeo)[26] <- "Vitamin.D"
R> l <- lm(cbind(Total.Z, Time.in.REM, Time.in.Deep, Time.in.Wake,
Awakenings, Morning.Feel, Time.to.Z)
~ Vitamin.D, data=zeo)
R> summary(manova(l))
Df Pillai approx F num Df den Df Pr(>F)
Vitamin.D 1 0.31 2.12 7 33 0.07
Residuals 39
R> summary(l)
Response Total.Z :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 533.37 8.16 65.37 <2e-16
Vitamin.D -19.73 11.14 -1.77 0.084
Response Time.in.REM :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 175.63 4.44 39.5 <2e-16
Vitamin.D -14.54 6.07 -2.4 0.021
Response Time.in.Deep :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 55.00 2.04 26.98 <2e-16
Vitamin.D 2.32 2.78 0.83 0.41
Response Time.in.Wake :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 26.32 3.83 6.88 3.2e-08
Vitamin.D 2.50 5.22 0.48 0.63
Response Awakenings :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.579 0.598 12.7 2.1e-15
Vitamin.D 0.739 0.817 0.9 0.37
Response Morning.Feel :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.842 0.134 21.21 <2e-16
Vitamin.D -0.524 0.183 -2.86 0.0067
Response Time.to.Z :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 17.58 3.43 5.12 8.6e-06
Vitamin.D 3.47 4.69 0.74 0.46
~~~
The MANOVA is tantalizingly close to statistical-significance (_p_=0.07); the variables:
Variable Effect _p_-value Coefficient's sign is...
------------ ---------------- ----------- -------------------------
`Total.Z` -19.73 0.084 worse
`Time.in.REM` -14.54 0.021 worse
`Time.in.Deep` 2.32 0.41 better
`Time.in.Wake` 2.50 0.63 worse
`Awakenings` 0.739 0.37 worse
`Morning.Feel` -0.524 0.0067 worse
`Time.to.Z` 3.47 0.46 worse
`Morning.Feel` jumps out as having a large effect (-0.5, on a 1-3 rating, is huge) and accordingly, a very low _p_-value which survives multiple-correction[^d-multiple]. Apparently I was waking up feeling like crap on the Vitamin D nights.
[^d-multiple]: [Correcting for multiple comparisons](#fn7) at _q_-value=0.05, of our 8 pessimistic _p_-values, 1 survives:
~~~{.R}
R> p.adjust(c(0.084,0.021,0.41,0.63,0.37,0.0067,0.46), method="BH") < 0.05
[1] FALSE FALSE FALSE FALSE FALSE TRUE FALSE
~~~
Remarkable - the first time a _p_-value survived. (That was the `Morning.Feel` one.)
Going back to my predictions after the first 10 days, they're *sort* of right:
1. sleep latency was increased, but not statistically-significantly and only by ~3m, which is less than half the predicted 10 minutes
2. increased awakenings was less than 1 additional awakening (compared to predicted 1-2) and didn't reach statistical significance
My conclusion?
Vitamin D hurts sleep when taken at night. I know of no reason that one would want to take vitamin D late at night, so I will definitely be avoiding it at that time in the future.
### VoI
> For background on "value of information" calculations, see the [first calculation](#value-of-information-voi).
The first experiment I had no opinion on. I actually did sometimes take vitamin D in the evening when I hadn't gotten around to it earlier (I take it for its anti-cancer and SAD effects). There was no research background, and the anecdotal evidence was of very poor quality. Still, it was plausible since vitamin D *is* involved in circadian rhythms, so I gave it 50% and decided to run an experiment. What effect would perfect information that it did negatively affect my sleep have? Well, I'd definitely switch to taking it in the morning and would never take it in the evening again, which would change maybe 20% of my future doses, and what was the negative effect? It couldn't be *that* bad or I would have noticed it already (like I noticed sulbutiamine made it hard to get to sleep). I'm not willing to change my routines very much to improve my sleep, so I would be lying if I estimated that the value of eliminating any vitamin D-related disturbance was more than, say, 10 cents per night; so the total value of affected nights would be $0.10 \times 0.20 \times 365.25 = 7.3$. On the plus side, my experiment design was high quality and ran for a fair number of days, so it would surely detect any sleep disturbance from the randomized vitamin D, so say 90% quality of information. This gives $\frac{7.3 - 0}{\ln 1.05} \times 0.90 \times 0.50 = 67.3$, justifying <9.6 hours. Making the pills took perhaps an hour, recording used up some time, and the analysis took several hours to label & process all the data, play with it in R, and write it all up in a clean form for readers. Still, I don't think it took almost 10 hours of work, so I think this experiment ran at a profit.
## Vitamin D at morn helps?
### Setup
The logical next thing to test is whether there is any benefit to sleep by taking vitamin D in the morning as compared to not taking vitamin D at all, since we have already established that evening is worse than morning. (Besides anecdotes, [Seth Roberts](http://blog.sethroberts.net/2012/04/28/effect-of-vitamin-d3-on-my-sleep/) reported - after I concluded my experiment - that his own non-blind varying of doses seemed to help his subjective restedness but didn't influence anything else.) I would expect any benefits in the morning to be attenuated compared to the evening effect: the morning is simply many hours away from going to bed again in the evening, giving time for many events to affect the ultimate sleep. So this experiment will run for more than 40 days of 20/20, but 56 days of 28/28; per Roberts's suggestion, I will not randomize individual days but 8 paired *blocks* of 7 days. (Multiple days to give any slow effects time to manifest, which seem eminently possible with a [fat-soluble vitamin](!Wikipedia) like vitamin D; 7 days, so we don't 'cycle around the week' but instead have exactly the same number of eg. active Sundays and placebo Sundays since sleep often varies systematically over the week.)
I prepare 27 placebo pills & 27 actives as before, stored in separate baggies. To randomize blocks of 7-days - I will fill 2 opaque containers with 7 placebo and 7 actives (with a label on the inside of the active container), and pick a container at random to use for the next 7 days. I will take one each morning upon awakening, closing my eyes. On the 8th morning, the first container will be empty, so I set it aside and open the second; when the second is emptied, I will look inside it to see whether it has the label, which lets me infer which one it was, and record whether the 2 weeks were active/placebo or placebo/active. The 2 containers will be refilled as before, and blocks 3-4 will begin. I will do this 4 times, at which point I will analyze the data.
Analysis will be the same Zeo parameters as before, but this time augmented by a simple mood indicator: 1-5, with 3 being an ordinary mildly productive day and 1 being 'my car caught on fire and was totaled' day (real data-point), recorded at the end of the day just before bed. (I considered a more complex mood indicator, the BOMS, while setting up my [lithium experiment](Nootropics#lithium), but rejected it as being too heavy-weight for long-term use, and subjectively, my mood doesn't vary that much.)
### Morning data
1. Blocks:
- 17-25F: guess: [placebo](http://predictionbook.com/predictions/6026) (last pill used morning 25; swapped jars and consumed pill from second jar the morning of 26); actual: placebo
- 26F-8M: skipped multiple days for modafinil (omit March 1, 2); actual: active
2. Blocks:
- 9M-15M: guess: [active](http://predictionbook.com/predictions/6431) actual: placebo
- 16-25: active (omit March 21)
3. Blocks:
- 26M-1A: guess: [placebo](http://predictionbook.com/predictions/6432) actual: placebo
- 2A-8: active
4. Blocks:
- 9A-19: (omit April 11, 12) guess: [placebo](http://predictionbook.com/predictions/6720) actual: placebo
- 20-27: active (omit April 21, 22)
Placebo/active coded as 0/1 in `SSCF.1`^[I originally input the data as 'Other Disruptions 4' through the Zeo web interface, since I assumed that if 'Other Disruptions 3' was `SSCF.12`, that would put the data into `SSCF.13` - but it turns out that does not get *exported in the CSV*! Apparently the CSV is limited to 1-3. So I edited the exported CSV and just reused `SSCF.1`. Hopefully Zeo Inc. will fix the export functionality, since it's very frustrating to be able to see the data used in the 'Cause & Effect' tool, for example, but not export it.] in the [CSV export](/docs/zeo/2012-zeo-vitamind-morning.csv). Mood was coded as fractional integers as the `Mood` column.
### Morning analysis
As before, we fire up `R` and analyze the spreadsheet with the usual assumptions[^morning-independence] about independence of the daily observations. The interpreter session:
~~~{.R}
zeo <- read.csv("http://www.gwern.net/docs/zeo/2012-zeo-vitamind-morning.csv")
R> # an example of the many intercorrelations which make simple t-tests misleading
R> # and motivate the use of multivariate linear regression:
R> cor(zeo[c(2,3,5:11, 25)], use="complete.obs")
Vitamin.D Mood Total.Z Time.to.Z Time.in.Wake Time.in.REM Time.in.Light
Vitamin.D 1.000000 -0.06210 0.01007 -0.004528 -0.14399 0.01844 -0.02043
Mood -0.062097 1.00000 0.03038 -0.229114 0.13365 -0.05137 0.06783
Total.Z 0.010067 0.03038 1.00000 -0.388734 -0.05258 0.77338 0.82402
Time.to.Z -0.004528 -0.22911 -0.38873 1.000000 0.17821 -0.29690 -0.28948
Time.in.Wake -0.143987 0.13365 -0.05258 0.178211 1.00000 -0.12396 0.15893
Time.in.REM 0.018437 -0.05137 0.77338 -0.296904 -0.12396 1.00000 0.35087
Time.in.Light -0.020427 0.06783 0.82402 -0.289484 0.15893 0.35087 1.00000
Time.in.Deep 0.054670 0.05648 0.57647 -0.299816 -0.35438 0.37922 0.24574
Awakenings -0.074435 0.09076 0.07645 0.142952 0.67797 0.04007 0.21834
Morning.Feel 0.053450 0.11313 0.62368 -0.285966 -0.04032 0.56241 0.51081
Time.in.Deep Awakenings Morning.Feel
Vitamin.D 0.05467 -0.07444 0.05345
Mood 0.05648 0.09076 0.11313
Total.Z 0.57647 0.07645 0.62368
Time.to.Z -0.29982 0.14295 -0.28597
Time.in.Wake -0.35438 0.67797 -0.04032
Time.in.REM 0.37922 0.04007 0.56241
Time.in.Light 0.24574 0.21834 0.51081
Time.in.Deep 1.00000 -0.28355 0.22280
Awakenings -0.28355 1.00000 0.02151
Morning.Feel 0.22280 0.02151 1.00000
l <- lm(cbind(Total.Z,Time.in.REM,Time.in.Deep,Time.in.Wake,Awakenings,Morning.Feel,Time.to.Z,Mood)
~ Vitamin.D, data=zeo)
summary(manova(l))
Df Pillai approx F num Df den Df Pr(>F)
Vitamin.D 1 0.0363 0.213 9 51 0.99
summary(l)
Response Total.Z :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 525.21 10.06 52.20 <2e-16
Vitamin.D 1.07 13.89 0.08 0.94
Response Time.in.REM :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 162.172 4.711 34.42 <2e-16
Vitamin.D 0.921 6.505 0.14 0.89
Response Time.in.Deep :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 65.34 2.53 25.85 <2e-16
Vitamin.D 1.47 3.49 0.42 0.68
Response Time.in.Wake :
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 27.76 3.10 8.94 1.4e-12
Vitamin.D -4.79 4.29 -1.12 0.27