The study, published online Feb. 10 in JAMA Internal Medicine, included 354 women who ranged in age from their 40s to mid-60s. All of the women reported being sexually active at the start of the study.
Each year for four years, researchers queried the women about their menopausal status and physical health. In the fourth year, women were specifically asked about their sexual function -- how strong their sex drive was, how easy or difficult it was to reach orgasm, and whether they had any trouble with arousal or vaginal dryness, or felt pain during intercourse.
After another four years, about 85 percent of the women continued to be sexually active. Women who stayed sexually active were more likely to be white, to have a lower body mass index (be thinner) and to say they felt sex was important.
"Women who felt that sex was highly important were about three times as likely to continue having sex as women who thought it was a little or not important," said study author Dr. Holly Thomas, a general internal medicine fellow at the University of Pittsburgh School of Medicine.
The good news is "if you go into midlife still sexually active, chances are, you're going to continue to be sexually active," Thomas said.
What caught the researchers off guard was that most women also scored poorly on the test of sexual function, meaning they reported significant physical difficulties with sex.
Thomas said that could mean a couple of things. The first is that the test, which was designed for premenopausal women, doesn't accurately reflect sexual intimacy at midlife. She thinks that after menopause, women may place a higher priority on kissing and touching than on intercourse, and the test they used in the study didn't really capture that.
She said the other thing it could mean is that women are using sexual aids, like lubricants, to overcome some of the trouble they have.
One expert on menopause was not surprised by the new findings.
"I think it resonates with what many of us have thought all along," said Dr. Margery Gass, an obstetrician/gynecologist at the Cleveland Clinic, in Ohio. She was not involved in the study.
"The quality of sexual activity for women as they age is much more than the sum of the various physical function components," said Gass, who is also executive director of the North American Menopause Society.
"That's not to say that there aren't some women who aren't having a very difficult time, but there are things that can be done for that," she said.
Visit the U.S. Office on Women's Health for more about sexuality after menopause.