Traci Watson, Special for USA TODAY

If your pet hamster nearly bites off your finger as you try to stroke its fur, don't assume it hates you. Maybe it's just in a bad mood.

Even hamsters have good moods and bad moods, scientists have found – and a hamster's emotional state can influence its outlook on life. A hamster in a sunnier frame of mind is more optimistic, while a gloomier hamster is inclined to a darker view of the world, the researchers learned.

Fortunately, the results confirm that a hamster doesn't need a pay raise or a shopping spree to cheer up. Little things -- a bigger pile of wood chips, a roomier running wheel – will do.

Both pet owners and scientists who work with the creatures should heed the findings, say the authors of the new study, which appears in this week's Royal Society Open Science. Some 1.1 million hamsters are kept as U.S. pets and another 120,000 live in U.S. laboratories.

"Although hamsters are cute, and happy hamsters sounds fun, there are very serious implications," says study author Emily Bethell, an animal behaviorist at Britain's Liverpool John Moores University. If scientists' lab hamsters are stressed, "the animals … aren't actually very good models for their scientific research."

Bethell and her colleague Nicola Koyama worked with Syrian hamsters, the orange-sized fur balls common in pet stores and classrooms. The hamsters were mum about their inner lives, so the researchers had to infer their moods through clever experiments.

The animals were allowed to roam a test area equipped with a single water bottle. If the bottle was to the far left, it held sugar water; if the bottle was to the far right, it held water laced with bitter quinine. The sweet-toothed hamsters quickly learned which was which.

Then the researchers deprived some hamsters of the comforts to which they'd grown accustomed, such as chew sticks. Luckier hamsters, however, got extra wood chips, little huts for snuggling and other perks.

Then hamsters were placed in a test area where the water bottle was confusingly positioned in the middle. The animals living in the nicer digs were more likely to approach the ambiguous bottle, hoping for the best. Many of the hamsters in the more barren homes, on the other hand, didn't bother.

The results suggest that more contented hamsters – like happier humans – are more optimistic. This connection between sunnier mood and optimism has been found in other animals as well, from rats to sheep, so it's no surprise it should be found in hamsters, says neuroscientist Rafal Rygula of the Polish Academy of Sciences, who has done similar work.

"Knowing that hamsters have emotions, and that a small, unenriched cage could make them unhappy and even pessimistic, will for sure make people think twice before deciding on the size and equipment of homes for their little friends," Rygula says via email.

The hamsters involved in Bethell and Koyama's experiments must now be some of the most optimistic animals in existence. They've been adopted by people who know how to treat a hamster right: students specializing in animal behavior and the like.

"They have happy endings here," Bethell says, in "very loving homes."