Homosexuality could be the result of a complicated interplay between genetics and random environmental factors, research from a large study of twins suggests.

Researchers from London's Queen Mary's School of Biological and Chemical Sciences and Stockholm's Karolinska Institutet studied all adult twins in Sweden (aged 20 to 47) in 2005-2006 to determine the impact of genetics (twins share the same genetic material) and the environment in the womb.

The 3,826 same-gender twin pairs who participated in the study were asked about the types and number of sexual partners they have had.

Fewer men (5.5 per cent) than women (7.8 per cent) reported they had a same-sex sexual partner. But men reported having more same-sex partners than women: The average number for men was 12.9 in men and 3.5 in women.

The study was based on the premise that while identical twins share all of their genes and their entire environment, fraternal twins share only half of their genes and their entire environment. That means that when identical twins share a certain trait, such as a same-sex preference, that trait is seen as more genetic in nature than if the twins are fraternal.

Using that thinking, researchers found that in men, 35 to 39 per cent of same-sex sexual behaviours were the result of genetic factors and 61 to 66 per cent the result of environmental factors.

Environmental factors included prenatal exposure to sex hormones or neurodevelopmental instability and did not include the role of societal attitudes, the effect of having the same family or parenting.

For women, 18 to 19 per cent of same-sex sexual behaviours were the result of genetic factors and 64 to 66 per cent the result of environmental factors, according to the study.

The researchers said the study appears to show that more than one factor is at play in shaping a person's sexuality, with genetics playing a lesser role than environment.

The researchers acknowledge that the study's flaws lie in the fact that there was a relatively low rate of homosexuality reported by the participants.

The study is published in the Archives of Sexual Behaviour.