Scientists said at the most basic level, it was the type of sperm which decided whether a child was a boy or a girl. If the sperm which fertilised the egg contained an X chromosome, a girl would be born, but if it was a Y chromosome, a boy would be the result, they added.
However, the environment within a woman's womb affect the likelihood of different types of sperm making it to the egg first, the researchers informed.
The study, conducted on cows, proved that a higher than average amount of testosterone in the womb made it easier for Y-bearing sperm than X sperm to fertilise, resulting in baby boys.
The New Zealand scientists also calimed that testosterone levels rose in women under stress so those feeling anxious could also be in line for sons.
''Results showed that follicular testosterone levels were significantly higher for subsequently male embryos,'' team leader Dr Valerie Grant of Auckland University told the Daily Mail.
She said the fact that testosterone levels rose in women after experiencing chronic stress could mean that they were more likely to have boys after a nerve-racking experience.