Old wives' tales assert that what people eat affects their sleep and their dreams, but there's been little evidence to prove or disprove these tales. Now a study finds that they may be true.

When a team of Canadian researchers surveyed more than 1,000 students at MacEwan University in Edmonton, they found that gluten intolerance, lactose intolerance and food allergies were strongly associated with nightmares.

“We are routinely asked if food affects dreaming, especially around food-centric holidays,” Tore Nielsen, lead author of the study, said in a statement. “Now we have some answers.”

Gluten intolerance, lactose intolerance and food allergies were strongly associated with nightmares.

Eating dairy may cause gastrointestinal disturbances, and the resulting discomfort may affect people's quality of sleep and lead to nightmares. This association makes sense because researchers know that other bodily sensations can affect sleep.

Nightmares can disrupt people's lives, especially if they occur often, said Nielsen. Nightmares can wake people up in a disoriented state. They can lead some people to avoid sleep.

In their online survey, the researchers asked the students how long they slept each evening and what they thought of the quality of their sleep. Then they queried the students about their mental and physical health and their relationship with food.

When the researchers asked the students if they had different kinds of dreams after eating certain foods, 5.5 percent said that yes, certain foods affected their dreams. More than 32 percent of participants reported having nightmares. Almost 37 percent of women said they had at least one nightmare a week compared to almost 21 percent of men.

More than 40 percent of students said specific foods affected the quality of their sleep and almost 13 percent said eating late at night affected their sleep. Almost 25 percent indicated particular foods worsened their sleep. Most blamed poor sleep on dairy, sweets and desserts and spicy foods. About 20 percent identified certain foods, including fruit, herbal tea and vegetables, that improved their sleep.

Eating dairy may cause gastrointestinal disturbances, and the resulting discomfort can affect people's quality of sleep and lead to nightmares.

There is some evidence in children of an association between certain foods, sleep and IQ, but the connection between food and sleep and dreams is not fully understood, so further studies are needed.

Going forward, Nielsen, a senior lecturer in the department of psychiatry and addiction at the Université de Montréal, and his team hope to gather specific information on the effect some foods have on dreams. “We would like to run a study where we ask people to eat either cheese or some control food before sleep, to see if it affects their sleep or their dreams.”

The study is published in Frontiers in Psychology.