As urban farming has taken off and demand for goat cheese, goat milk and goat meat has increased, the number of goats in the world has understandably grown.

Today, there are nearly 900 million goats worldwide, up from 600 million in 1990.

With all these goats out there, more researchers are analyzing the animal's behavior, and a recent study answers an interesting question: How do you know if a goat is happy?

Alan McElligott, a senior lecturer in animal behavior and welfare at the Queen Mary University of London, says it's especially important for goat farmers to know if their herd is in a positive or negative state of mind. "If animals have chronic stress, they're far more likely to get ill," he told NPR. "That costs money in terms of medicine and vet bills."

McElligott and his colleagues conducted a study this summer to determine how we can know a goat's emotional state. In the study, researchers put goats into "positive" or "negative" situations and observed them, using microphones, video cameras and heart rate monitors.

To create a positive situation, McElligott used "food anticipation," which involved shaking a bucket of food for a few seconds before approaching a goat and feeding it. During this time, the goat perked up in anticipation of a positive experience.

In the negative situations, two goats were put in adjacent pens and only one was fed while the other watched for five minutes.

Through these experiments, researchers found that one of the best ways to gauge a goat's mood was the position of its ears. Goats were more likely to point their ears forward if they were in a positive state.

The animals also moved their heads more, had their tails up, produced more calls and had a more stable pitch in their call when they were happy.

However, when they were in a negative state, the goats were more likely to have their ears back and their calls would fluctuate, going up and down in pitch.

Other recent studies involving goats have found that the animals are quite intelligent. Goats have proven they're able to solve puzzles and that they have excellent long-term memory.

Related on MNN: