SASKATOON -- Having trouble sleeping? One of the largest studies of its kind says that could be strongly linked to mental illness.

People diagnosed with mental illness in their life were more likely to have poorer sleep quality compared to the general population, the Centre for Addiction and Mental Health (CAMH) said in findings recently .

鈥淭he differences in sleep patterns indicated worse sleep quality for participants with a previous diagnosis of mental illness, including waking up more often and for longer periods of time,鈥 Shreejoy Tripathy, senior author and an independent scientist at CAMH鈥檚 Krembil Centre for Neuroinformatics, said in a .

鈥淧oor sleep contributes to poor mental health and poor mental health contributes to poor sleep,鈥 explained Michael Wainberg, the study鈥檚 lead author and a postdoctoral researcher at centre.

鈥淪leep pattern differences were a feature of all mental illnesses we studied regardless of diagnosis,鈥 he said, adding that gauging the quality of sleep was just as important as figuring out its effect on people鈥檚 mental health.

have linked people鈥檚 chronic sleep problems to their psychiatric conditions including anxiety, depression, bipolar disorder, and attention deficit hyperactivity disorder.

But Tripathy explained, 鈥渦ntil now nobody has looked at objectively measured sleep in the context of mental illness at quite this scale before.鈥

WRIST DEVICES TRACKED PEOPLE'S BODY MOVEMENTS

To put the study together, data was taken from 89,205 participants in the United Kingdom who agreed to wear an accelerometer on their wrist that tracked their body movement -- 24 hours a day for seven days. The data was then stored in a digital patient data biobank.

Using computational algorithms, researchers broke down the huge amounts of data into metrics, such as people鈥檚 bedtime, the time they woke up, naps, and the longest amount of time they had uninterrupted sleep. Then, the team looked at whether people had a diagnosis of mental illness in their life at any point, contrasted to those who hadn鈥檛.

have shown the of collecting data through these accelerometers and parsing information gathered from people in their natural sleep environments rather than in a laboratory setting.

鈥淧art of why we wanted to do this study is that with the emergence of smartphones and wearables, we have access to data streams that we never had before,鈥 Tripathy said.

Michael Mak, a CAMH psychiatrist and sleep disorder specialist, said that up to 80 per cent of people with mental health disorders can end up spending more time tossing and turning; or have trouble staying asleep or waking up earlier than they鈥檇 wanted.

鈥淲e know that sleep disturbances cause a great burden to society, including an economic one. And we know that treatments that improve sleep quality, whether it is therapy or some types of medication, can improve mental health outcomes.鈥

The Krembil Centre for Neuroinformatics is currently in the process of creating a Canadian patient data biobank, similar to the one used in the U.K., to drive future clinical research here and ultimately better personalize patients鈥 mental health care.