Your beloved pet may be affecting your sleep, according to research published Thursday.

Although pets can have many positive effects on health, owning a pet was linked to less sleep, according to the study published in the journal Human-Animal Interactions.

The researchers analyzed data from the National Health and Nutrition Examination Survey, which asks questions on a variety of health topics. They adjusted for factors that could affect sleep, including race and income, as well as age, gender and BMI, and focused on whether a person had a sleep disorder and whether they owned a cat or dog.

Sleep quality was measured by observing reported episodes of snoring or snorting during the night; being diagnosed with a sleep disorder; have trouble sleeping or falling asleep; waking up during the night; waking up too early; feel restless; you have not slept enough; need medication to sleep; or have pulls or leg cramps. Taking more than 15 minutes to fall asleep and regularly sleeping less than six hours were also indicators of lack of sleep.

The findings showed that owning a dog was associated with a higher likelihood of having a sleep disorder and having trouble sleeping in general, while owning a cat was associated with a higher likelihood of leg twitching at night.

The study was observational, meaning the researchers couldn’t say for sure that pets caused poor sleep, but the results were consistent with previous studies that found pet ownership negatively affected sleep quality.

The study’s lead author, Lauren Wisnieski, an assistant professor of public health and research at Lincoln Memorial University in Tennessee, noted that the study didn’t look at where people’s pets slept. For example, does a dog take up all the space on the bed? Is there a cat curled up right next to the pet owner’s head?

That would be a good direction for future studies, he said, «asking owners more about where their pets sleep and how those pets disrupt their sleep.»

How to sleep better with a pet

Lieve van Egmond's cat.
Lieve van Egmond noted that her dream changed when she had her cat, Bacco.Courtesy of Lieve van Egmond

Lieve van Egmond, a sleep researcher at the Uppsala Sleep Science Laboratory in Sweden, noticed that her sleep changed when she had her kitten, Bacco. She researched the relationship between pets and sleep quality while she was earning her Ph.D. She was not involved in the new study, but led a separate study study who also used self-reported data to examine how pets can affect sleep.

In that study, published in 2021, van Egmond and her team found that owning a cat was associated with a shorter night’s sleep, but owning a dog was not associated with changes in sleep. Still, he noted that more research would be needed to establish whether the findings were coincidental or whether the pets were actually causing sleep problems.

He said the association found in the new study likely has more to do with owning a pet, and the many different factors associated with that single cat or dog, than where those pets sleep.

“The age of the pet has a big influence on whether or not they keep you up at night,” van Egmond said. «If you have multiple pets, they may goad each other.»

With dogs, he said, it depends a lot on the breed and the level of activity he needs. Making sure a pet gets plenty of physical activity and mental stimulation throughout the day and working with their natural instincts can help animals, and their owners, rest better.

Unlike dogs, cats tend to have bursts of energy at night, van Egmond said. That was certainly the case with Bacco, who would run circles around her apartment and, even if her bedroom door was closed, he would wake her up by scratching her to let him in, he said.

She eventually consulted a cat behavior specialist and discovered that playing with Bacco before she was ready for bed would trigger the cat’s prey drive. Being fed after that, Bacco would feel that he had successfully hunted food from him and was rewarded with a good meal in return. After that, her natural instinct was to get ready and go to sleep, just as van Egmond was getting ready for bed.

The new study “indicates that pets can influence your sleep, but we really have to keep in mind that pets are much more than a sleep facilitator or inhibitor. They are part of the family,” he said.

Still, people can use this information to assess why they might not be getting enough rest, he said.

«If you have pets and they don’t sleep well, you should see where this is coming from,» van Egmond said. If it’s the pet, «see where the bottleneck is and how you can make sure the cat or dog doesn’t interrupt you when you’re sleeping.»

Continue NBC HEALTH in Twitter & Facebook.