Having pets in the house when kids are born could make them less likely to develop food allergies, especially if they happen to be a dog or a cat.

Hamsters, however, seem to be an unusual exception.

These findings are based on an analysis of data on 66,215 young children in Japan. Around 22 percent of those studied were exposed to pets through their mothers while still in the womb, which included both indoor and outdoor dogs, cats, hamsters, turtles, and birds.

The team of researchers from Fukushima Medical University in Japan think the study provides sufficient evidence to show a link between pet exposure and allergies – though the details vary depending on the type of animal and the type of food.

"The hygiene hypothesis suggests that pet exposure is effective in preventing allergic disease, and some studies have reported the beneficial effects of dog exposure during fetal development or early infancy on food allergy," write the researchers in their published paper.

"However, the effects of exposure to pets other than dogs on the kinds of food allergies remains unaddressed."

Kids exposed to indoor cats and dogs were significantly less likely to have allergies, the study found. That included allergies to eggs, milk, and nuts for dogs, and eggs, wheat, and soybean for cats. While the overall trend seems to be that having pets around is better, there are clearly variations.

The same couldn't be said for dogs kept outdoors, for example. And those who had hamsters at home (0.9 percent of the children), were significantly more at risk of developing a nut allergy.

"Our findings suggest that exposure to dogs and cats might be beneficial against the development of certain food allergies, thereby alleviating concerns about pet keeping and reducing the burden of food allergies," write the researchers.

The study isn't enough to prove cause and effect, and it's also worth bearing in mind that the findings are based on questionnaire responses, not observations. The researchers could only speculate on the nature of the relationship, suggesting pet exposure might change the mix of gut microbes in kids, or it might be something animals shed that boosts immunity.

It's also been suggested that keeping pets at home could protect against atopic dermatitis, a skin condition that's been linked with allergies. More data on bigger groups of people will be needed to find out for sure.

What we do know is that allergies are on the rise, now affecting more than 10 percent of people in developed countries. We need to better understand what's behind the trend and how we might reverse it.

"Further studies using oral food challenges are required to more accurately assess the incident of food allergies," write the researchers. "Nevertheless, the findings of this study shall aid in the design of future studies."

The research has been published in PLOS ONE.