# A Formula For Risk of Nightmares

As already noted in this blog post, I recently conducted a survey on sleeping which also included the topic nightmares. The strongest effects on the occurrence of nightmares come from the variables age, depression and stress. While among younger people (age 36 or lower) roughly 50 % frequently have nightmares, the same is true for only 27 % of older people. A statistical test shows that this difference has a very strong statistical significance. Depression led the nightmare risk to rise from 24 % (no tendency for depression, self-reported) to 57 % (strong tendency for depression) and stress from 21 % (low stress level, self-reported) to 50 % (high stress level). Both increases were also statistically significant.

There were other variables that also led to an increase in the nightmare risk as well, though none of them as robust as age, depression and stress. The living conditions have a noticeable effect. A busy road increases the risk by 22 %, noisy family members or roommates by 26 % and noisy neighbors by 27 %. Also noteworthy are the effects of lifestyle. Frequently drinking stimulating beverages adds 15 % to the nightmare risk, smoking adds 16 %, alcohol adds 18 %, cannabis adds 21 % and eating late roughly 13 %. At this point, even a little before that, the differences went below the threshold for statistical significance. One more thing I can say is that the variables education, income and sleeping alone do not seem to have any effect at all on the risk of nightmares.

————————-

With all of this input I produced a predictor variable and a formula to compute the nightmare risk. Define the following variables:

Lifestyle Variable:
L = 1/5*(Stim Beverages + Smoking + Alcohol + Cannabis + Eating Late)

Circumstance Variable:
C = 1/3*(Busy Road + Noisy Family + Noisy Neighbor)

Mind Variable:
M = 1/2*(Stress + Depression)

All individual points range from 1 (no) to 5 (yes). For example, when a person never drinks stimulating beverages such as Coke or Coffee, set Stim Beverages = 1, if a person heavily consumes stimulating beverages, set Stim Beverages = 5. This way you can produce the values of L, C and M. Once these values are known for a person, one may compute the predictor P:

P = 0.6*M + 0.3*C + 0.2*L + 0.5*(90/Age)

And then insert the predictor P into this formula, that was found by regression analysis, to calculate the nightmare risk of this person:

Risk = 0.802 – 0.720 / ( 1 + (P / 4.55)^5.12 )

Where the symbol ^ means “to the power of”. To asses the accuracy of the formula, I compiled the table below. It shows the predictor range with the corresponding nightmare risk as measured in the survey and as calculated from the formula (in the bracket) for the midpoint of the predictor interval.

2.0-2.5 … 10 % (10 %)
2.5-3.0 … 19 % (13 %)
3.0-3.5 … 17 % (19 %)
3.5-4.0 … 25 % (28 %)
4.0-4.5 … 41 % (38 %)
4.5-5.0 … 45 % (48 %)
5.0-5.5 … 61 % (57 %)
5.5-6.0 … 68 % (64 %)

So while there are deviations, the formula works quite well for the most parts.

————————-

Let me demonstrate the process of finding the nightmare risk using the formula, I’ll offer myself as the test subject. Here are my values for the variables. Remember that each variable ranges from 1, a strong no, to 5, a strong yes.

Lifestyle Variable:
L = 1/5*(Stim Beverages + Smoking + Alcohol + Cannabis + Eating Late)
L = 1/5*(4 + 5 + 2 + 1 + 4) = 3.2

Circumstance Variable:
C = 1/3*(Busy Road + Noisy Family + Noisy Neighbor)
C = 1/3*(3 + 1 + 1) = 1.7

Mind Variable:
M = 1/2*(Stress + Depression)
M = 1/2*(4 + 4) = 4

Predictor:
P = 0.6*M + 0.3*C + 0.2*L + 0.5*(90/Age)
P = 0.6*4 + 0.3*1.7 + 0.2*3.2 + 0.5*(90/32) = 5

Nightmare Risk:
Risk = 0.802 – 0.720 / ( 1 + (P / 4.55)^5.12 )
Risk = 0.802 – 0.720 / ( 1 + (5 / 4.55)^5.12 ) = 0.53 = 53 %

So roughly 50/50, not that bad actually. I would say that puts me in the risk group, but luckily not the high-risk group.

# Survey on Sleeping – Longest Time Awake

Here I presented some basic results of my survey on sleeping. The analysis showed that the male respondents reported having been awake a maximum of 40.6 h, while for women this was 36.6 h, not an enormous difference, but statistically significant at p < 0.05. I also wanted to give you the breakdown for all of the respondents, male or female:

You can see that around 25 % (1 in 4) never made it past the 24 h mark. Roughly the same percentage (adding up the final four bars) made it past the 48 h mark and a brave 4.4 % (1 in 23) even past the 72 h mark. Feel free to use the comments section to tell me what the longest time you were awake was and what the circumstances were that made you stay up so long.

# Survey on Sleeping

I conducted a paid survey via AYTM on the topic of sleeping. I was interested in finding out what variables (psychological, lifestyle, circumstance) have a noticeable effect on sleep related issues such as nightmares, sleep duration, time needed to fall asleep, etc … Now that I’ve got the raw data result, there’s a ton of relationships to analyze and that will take time. But I’ve already found a few neat statistically significant results, some to be expected, some rather surprising. I’ll publish them, as well as the results yet to be found, here on my blog in the coming weeks.

Geographic Region: US

Number of Respondents: 250

Males: 96 (38.4 %)
Females: 154 (61.6 %)

Minimum Age: 18
Median Age: 36
Maximum Age: 81

White-American: 163 (65.2 %)
African-American: 23 (9.2 %)
Asian-American: 17 (6.8 %)
Hispanic-American: 28 (11.2 %)
Other: 19 (7.6 %)

Here’s what I extracted from the data so far. Statistical significance was determined via a two-population Z-test. Notice the p-value. You can interpret it as the chance that the result came to be by random fluctuations rather than via a real effect. Hence, the lower the p-value, the more significant and reliable the result. A p-value of 0.05 roughly means that there’s a 1 in 20 chance that the result is just a random fluctuation, a value of 0.01 that there’s a 1 in 100 chance for the same. All of the results below are significant at p < 0.05, some even at p < 0.01.

By the way: if you’ve got your own data, you can let this great website do a two-population Z-test for you. Only works though if you’ve got the result in form of a percentage. To learn more about hypothesis testing, including how to perform a Z-test if the data is not given in form of a percentage, check out this great book by Leonard Gaston.

——————————————————————————
AGE:
——————————————————————————

————————–
Hypothesis: Young people have more nightmares
————————–

Percentage of people with nightmares for people at median age or younger: 49.6 %
Number of respondents: 127

Percentage of people with nightmares for people older than median age: 26.8 %
Number of respondents: 123

The Z-Score is 3.706. The p-value is 0.0001. The result is significant at p < 0.01.

Correlation between age and probability for nightmares: Probability = 0.757 – 0.00958·Age
(Every year the chance for nightmares goes down by roughly 1 %)

————————–
Hypothesis: Young people are more light sensitive
————————–

Percentage of light sensitive people for people at median age or younger: 62.2 %
Number of respondents: 127

Percentage of light sensitive people for people older than median age: 49.6 %
Number of respondents: 123

The Z-Score is 2.0065. The p-value is 0.02222. The result is significant at p < 0.05.

Correlation between age and probability for light sensitivity: Probability = 0.756 – 0.00504·Age
(Every two years the chance for light sensitivity goes down by 1 %)

————————–
Hypothesis: Older people more frequently take naps
————————–

Percentage of people taking naps for people at median age or younger: 23.6 %
Number of respondents: 127

Percentage of people taking naps for people older than median age: 33.3 %
Number of respondents: 123

The Z-Score is 1.7009. The p-value is 0.04457. The result is significant at p < 0.05.

Correlation between age and probability for taking naps: Probability = 0.194 + 0.00232·Age
(Every four years the chance for taking naps goes up by 1 %)

——————————————————————————
GENDER:
——————————————————————————

————————–
Hypothesis: Females wake up more frequently at night
————————–

Percentage of males who frequently wake up at night: 51.1 %
N = 96

Percentage of females who frequently wake up at night: 64.3 %
N = 154

The Z-Score is 2.081. The p-value is 0.03752. The result is significant at p < 0.05.

————————–
Hypothesis: Males have a higher peak waking duration
————————–

Peak waking duration for males: 40.6 h
SEM: 1.76 h

Peak waking duration for females: 36.6 h
SEM: 1.33 h

The Z-Score is 1.8132. The p-value is 0.0349. The result is significant at p < 0.05.

——————————————————————————
INCOME:
——————————————————————————

————————–
Hypothesis: People with low income daydream more
————————–

Percentage of people with low income who frequently daydream: 40.1 %
N = 142

Percentage of people with high income who frequently daydream: 26.9 %
N = 108

The Z-Score is 2.1764. The p-value is 0.01463. The result is significant at p < 0.05.

————————–
Hypothesis: People with low income take longer to fall asleep
————————–

Time to fall asleep for people with low income: 31.4 min
SEM = 1.44 min

Time to fall asleep for people with high income: 22.9 min
SEM = 1.08 min

The Z-Score is 4.7222. The p-value is < 0.00001. The result is significant at p < 0.01.

——————————————————————————
DEPRESSION:
——————————————————————————

————————–
Hypothesis: Depressed people have more nightmares
————————–

Percentage of people with nightmares for depressed people: 57.1 %
Number of respondents: 84

Percentage of people with nightmares for non-depressed people: 28.9 %
Number of respondents: 166

The Z-Score is 4.3308. The p-value is 0. The result is significant at p < 0.01.

————————–
Hypothesis: Depressed people daydream more
————————–

Percentage of depressed people who frequently daydream: 50.3 %
N = 84

Percentage of non-depressed people who frequently daydream: 26.5 %
N = 166

The Z-Score is 3.7392. The p-value is 9E-05. The result is significant at p < 0.01.

————————–
Hypothesis: Depressed people need more time to feel fully awake after a good night’s sleep
————————–

Time to feel fully awake for depressed people: 42.5 min
SEM: 2.70 min

Time to feel fully awake for non-depressed people: 28.9 min
SEM: 1.27 min

The Z-Score is 4.5580. The p-value is < 0.00001. The result is significant at p < 0.01.

——————————————————————————
OTHERS:
——————————————————————————

————————–
Hypothesis: People who need more time to fall asleep also need more time to feel fully awake after a good night’s sleep
————————–

Time to feel fully awake for people who need less than 30 minutes to fall asleep: 29.9 min
SEM: 1.77 min

Time to feel fully awake for people who need 30 minutes or more to fall asleep: 37.1 min
SEM: 1.92 min

The Z-Score is 2.7572. The p-value is 0.002915. The result is significant at p < 0.01.

Correlation between time falling asleep (FAS) versus time to feel fully awake (FAW):

FAW = 24.7 + 0.317*FAS

(Every ten minutes additional time needed to fall asleep translate into roughly three minutes additional time required to feel fully awake after a good night’s sleep)