LOS ANGELES — To improve your odds of a high-quality marriage, try not to have too many sexual partners before you meet “the one.” And when you do find him or her, consider inviting at least 150 people to your wedding.

That’s just some of the practical advice offered by two psychology researchers from the University of Denver who have studied 418 people who participated in the Relationship Development Study. All of them were single and between the ages of 18 and 40 when they joined the study in 2007 and 2008, and all of them had tied the knot by the time the researchers checked in with them five years later.

The goal was to identify patterns of behavior that tended to set people up for successful and fulfilling marriages. The researchers asked study volunteers questions about “marital happiness, confiding in one another, believing things are going well in the relationship, and thoughts of divorce,” according to their report published this week. Those who ranked in the top 40 percent were considered to have “high-quality marriages.”

The researchers – Galena Rhoades and Scott Stanley – emphasized that the choices men and women make long before they say “I do” seem to have a strong influence on their marriages years later.

“What happens in Vegas doesn’t stay in Vegas, so to speak,” they wrote. “Our past experiences, especially when it comes to love, sex, and children, are linked to our future marital quality.”

For instance, the study volunteers were asked how many sexual partners they had before they got married, and the response (on average) was five. But 23 percent of them had slept only with the person they married, and they scored higher on the marriage quality test than those who had more experience. In fact, for women, the higher the number of sexual partners, “the less happy she reported her marriage to be,” according to the report.

People who had already been through a divorce or who had lived with someone before meeting their current spouse were also less likely to have a high-quality marriage. The researchers found that 35 percent of these people earned that designation, compared with 42 percent of those who had only lived with their eventual spouse.

What’s wrong with having a past? “More experience may increase one’s awareness of alternative partners,” Rhoades and Stanley wrote, and “a strong sense of alternatives is believed to make it harder to maintain commitment to, and satisfaction with, what one already has.”

There’s also the fact that people who have more ex-significant others have been through more breakups. “A history of multiple breakups may make people take a more jaundiced view of love and relationships,” they added.

The researchers also noted that 24 percent of the people in the study either had children from a prior relationship by the time they tied the knot or married someone who did. “There is no question that raising children from prior relationships can add stress to a marriage,” the researchers wrote.

Couples that took relationship milestones seriously were more likely to have high-quality marriages compared with couples that merely stumbled into things. For instance, 32 percent of the study volunteers said their relationship with their husband or wife began with a casual hookup. Among these people, 36 percent had a high-quality marriage, compared with 42 percent of those who took things more slowly.

Likewise, among couples who moved in together before “making a commitment to marry,” only 31 percent had a high-quality marriage, the researchers reported. That compares with 43 percent of couples who decided to live together only after agreeing that they were on a path to marriage.

Rhoades and Stanley theorized that once men and women had meshed their finances, furniture and pets, the effort required to get out of a less-than-ideal relationship was too great.

A safer way to test a relationship would be to take a trip together or meet one another’s families, they said.

Even worse than casually moving in together before marriage was having a child together before marriage, at least for those who had graduated from college. Only 3 percent of college-educated couples who had a baby before they got married had a high-quality marriage. That compares with 44 percent of college-educated couples who had no child together.

Finally, among the study volunteers, 11 percent did not have a formal wedding ceremony, and only 28 percent of these couples had a high-quality marriage. Meanwhile, 41 percent of couples that did have formal weddings achieved high-quality marriage status.

And, 47 percent of couples that got hitched in front of 150 or more guests had high-quality marriages.