WEDNESDAY, April 11 (HealthDay News) -- Being nice may be in your genes.

That's according to a new study that found that genes are at least part of the reason why some people are kind and generous.

Researchers at the University at Buffalo and the University of California, Irvine assessed the behavior of people with different versions of receptor genes for two hormones -- oxytocin and vasopressin -- believed to make people nicer.

"The study found that these genes combined with people's perceptions of the world as a more- or less-threatening place, to predict generosity," principal author Micheal Poulin, an assistant professor of psychology at the University at Buffalo, said in a university news release. "Specifically, study participants who found the world threatening were less likely to help others -- unless they had versions of the receptor genes that are generally associated with niceness."

Poulin explained that the "nicer" versions of the receptor genes "allow you to overcome feelings of the world being threatening and help other people in spite of those fears."

The study was released online in advance of publication in an upcoming print issue of the journal Psychological Science.

"The fact that the genes predicted behavior only in combination with people's experiences and feelings about the world isn't surprising because most connections between DNA and social behavior are complex," Poulin said.

"So if one of your neighbors seems [to be a] really generous, caring, civic-minded kind of person, while another seems more selfish, tight-fisted and not as interested in pitching in, their DNA may help explain why one of them is nicer than the other," he noted.

"We aren't saying we've found the niceness gene," Poulin added. "But we have found a gene that makes a contribution. What I find so interesting is the fact that it only makes a contribution in the presence of certain feelings people have about the world around them."

More information

The American Psychological Association explains how parents can teach their children to be kind.