Public acceptance of premarital sex and same-sex relationships is at an all-time high in the United States, according to a study from San Diego State University.

Researchers came to that conclusion after combing data from the General Social Survey, a national survey of 33,000 American adults taken between 1972 and 2012.

The researchers said they found substantial differences in attitudes toward sex among different generations.

The biggest gap was between the World War II generation, born in the early 1900s, and their baby boomer children, born in the 1940s and 1950s. However, there was still a noticeable difference between millennials, born during the two decades before 2000, and their parents.

“In the 1950s and earlier, men and women rarely lived together before marriage, unmarried women who bore children were shunned, and homosexuality was considered shameful,” the study authors wrote. “In more recent times and among more recent generations, however, Americans are presumably more accepting of sexual activity outside of marriage and more likely to participate in it.”

The results of the study are being published on the Archives of Sexual Behavior website.

Read More: How to Talk to Your Kids About Sex »

What the Numbers Reveal

The researchers said the national survey revealed overall acceptance of premarital sex has doubled in the past 40 years.

In the 1970s, 29 percent of Americans said premarital sex between consenting adults was “not wrong at all.” That percentage jumped to 42 percent in the 1980s and 1990s. It increased to 49 percent in the 2000s and then rose to 58 percent in 2012.

In addition, acceptance of same-sex relationships has tripled in the past 25 years, rising from 13 percent in 1990 to 44 percent in 2012. State laws legalizing same-sex marriage reflect these changing attitudes.

The number of sexual partners a person has over a lifetime peaked with the baby boomers. Researchers said the average was about 2 partners for the World War II generation, nearly 12 for boomers, and slightly more than 8 for millennials.

What’s Behind the Generational Shift?

Researchers say millennials are driving the change in acceptance of premarital sex and same-sex relationships, though they may not have as many sexual partners as their parents did.

Read More: New Technology Is Causing a Lifetime of Pain for Millennials »

Jean M. Twenge, Ph.D., the author of “Generation Me” and a professor of psychology at San Diego State, said the shift is most likely due to growing “cultural individualism” in the United States.

The study noted, among other things, that song lyrics and written language are now more likely to use first and second person singular pronouns, such as “I,” “me,” and “you,” rather than plural pronouns, such as “we” and “us.”

“When the culture places more emphasis on the needs of the self and less on social rules, more relaxed attitudes toward sexuality are the almost inevitable result,” Twenge said.

She added the study also shows that attitudes toward sexuality are solidified early in life.

“The changes are primarily due to generation, suggesting people develop their sexual attitudes while young, rather than everyone of all ages changing at the same time,” said Twenge.

The study authors said changes in attitudes about sex are important because these stances can impact things like rates of sexually transmitted diseases and pregnancy, laws surrounding domestic abuse, and an individual’s mental health.

Read More: Baby Boomer Suicide Rate Rising, May Go Higher »