San Diego County has again earned above-average but not stellar rankings for the health of its residents compared with the rest of California and the nation, a new study shows.

Easy access to fast food joints and comparatively high rates of sexually transmitted disease were problems in San Diego compared with statewide, according to the third annual “County Health Rankings” released Tuesday by the University of Wisconsin Population Health Institute and the Robert Wood Johnson Foundation.

On the other hand, San Diego performed well compared with both state and national figures in providing adequate outpatient care to avoid preventable hospital stays. Smoking and obesity rates were lower than state and national averages, and while the county’s air pollution statistics ran higher than national benchmarks, San Diego had fewer smoggy days than statewide figures, according to the study.

San Diego ranked 18th among 56 California counties in overall health in the 2012 report, down from 16th last year. The category looks at rates of premature death and broad questions of physical and mental health.

San Diego also ranked 22nd this year, compared with 21st in 2011, in a category called “health factors” that looked at 24 areas related to behavior, medical care, social and economic factors, and the physical environment.

“I wouldn’t consider this year’s rankings to be significantly different” for San Diego, said Julie Willems Van Dijk, a study researcher.

The study gauges the public’s health in counties across the nation so communities can pinpoint areas to improve, she said.

“This gives you information to look at where you might want to focus your efforts,” Van Dijk said. “But you can also celebrate where you’re doing well.”

California has reason to celebrate its tobacco control policies, she said, which are among the first and toughest in the nation and have made the state second only to Utah in low rates of smoking.

Van Dijk said that for San Diego, areas of improvement could include trying to lower the rate of children living in poverty. The study found 19 percent of San Diego’s children live below the federal poverty line compared with 13 percent nationwide.

Researchers also found that 51 percent of San Diego’s restaurants are fast food eateries, compared with 25 percent nationwide and 49 percent statewide. Studies have shown a link between easy access to fast food and a higher prevalence of obesity and diabetes. The study also found that 4 percent of San Diegans have limited access to healthy food, defined as living less than a mile from a grocery store in metropolitan counties and less than 10 miles in non-metropolitan counties.

“Some communities might want to think about how they want to zone to encourage more access to healthy food choices,” Van Dijk said.

The 2012 top five list of counties for overall health are all in Northern California. They are: Marin, Santa Clara, San Benito, Placer and San Mateo. In Southern California, Orange County ranked sixth, Los Angeles County was 28th, and San Bernardino came in 41st.