Forget counting sheep, ditch the sleeping pills and don't bother with a glass of warm milk, a good remedy for women who can't sleep is a happy marriage.

Researchers at the University of Pittsburgh have found that women who are happy with their husbands or partners have less trouble sleeping than their single, unattached counterparts.

Money worries, alcohol and caffeine consumption, and how often they had sex, had little impact on getting a good eight hours of sleep each night.

Click here for 5 ways to get a better night's night's sleep.

"We found that happily married women report fewer sleep disturbances including difficulty falling asleep, nighttime awakenings, early morning awakenings, and restless sleep, as compared to women reporting lower marital happiness," said Wendy Troxel, an associate professor of psychiatry who headed the study.

Women usually report more sleep problems than men, but most research has focused on how men's sleep problems such as snoring and sleep apnea affect their wives.

Troxel and her team took a different approach. They interviewed 1,938 women aged 42 to 52 of different ethnic backgrounds in seven major U.S. cities to explore the link between marital happiness and sleep.

They also considered other factors that might contribute to sleeplessness such as depressive symptoms, economic hardship and employment status, alcohol and caffeine consumption, children and sexual activity.

"The results showed that even after taking into account all of these factors that are known to influence sleep, the level of marital happiness emerged as an independent risk factor for the existence of sleep disturbances," Troxel, who reported the findings in the journal Behavioral Sleep Medicine, added in a statement.

Caucasian and African-American women reported more sleep complaints than Japanese, Hispanic and Chinese women, although Caucasian and Japanese participants reported the highest rate of marital happiness.

"Being happily married was associated with fewer sleep disturbances, even after accounting for sleep medications," Troxel told Reuters.

The study included African American women in Boston, Chicago, Detroit, and Pittsburgh, as well as Chinese women in Oakland, California, Japanese women in Los Angeles and Hispanics in Newark.