Continuing its winning streak, Marin County was ranked as the healthiest county in California for the seventh consecutive year in a new report released Tuesday.

The rankings, done by the Robert Wood Johnson Foundation and the University of Wisconsin Population Health Institute, compare counties on more than 30 factors that influence health including length of life, quality of life, health behaviors, access to health care, socioeconomic factors and physical environment.

“Community investments such as reserving land for open space and social norms around healthy eating and staying active have helped Marin maintain our ranking,” said Dr. Grant Colfax, director of Marin County’s Department of Health and Human Services, in a release.

Marin earned its lowest ranking, No. 13, in the category of physical environment, which includes the number of residents who report having severe housing problems and long commutes.

According to the report, 41 percent of Marin residents spend more than 30 minutes commuting to work in their car alone. That puts Marin among the 10 counties with the longest solo commutes in the state. Nationally, the top performers in this category had just 15 percent of their residents reporting long commutes.

The report estimates that 24 percent of Marin’s residents are dealing with severe housing problems due to either overcrowding, high costs, or lack of kitchen or plumbing facilities. Marin ranked better than the state average of 29 percent in this category; nationally, however, top performers in this category had just 9 percent of their residents reporting severe housing problems.

In all the other major categories, Marin was ranked either first, second or third best in the state. Fewer Marin County residents per 100,000 die before age 75 than any other county with significant data. Marin’s rates of adult smoking, obesity, physical inactivity and teen births are all below the state average.

There were, however, specific health behaviors that Marin didn’t outperform the state average on: adults reporting binge or heavy drinking at 18 percent, driving deaths with alcohol involvement at 32 percent and drug overdose deaths at 12 per 100,000 population.

The report found that Marin residents’ access to health care is better than the state average. It estimates that 12 percent of the county’s population lacks health care insurance compared with the state average of 19 percent. Only two other counties — San Francisco and San Mateo — have equally high percentages of their population insured.

With one primary care physician for every 690 residents, Marin was second only to San Francisco County, which has one primary care physician for every 629 residents. Marin County also ranked second to San Francisco with its 150-to-1 ratio of mental health providers. And Marin ranked third in the state with its 930-to-1 ratio of dentists.

Both Colfax and Dr. Matt Willis, the county’s public health officer, cautioned that Marin’s high marks in this report obscure communities of need within the county. For example, Marin residents living in Ross live an average of 16 years longer than Marin residents living in Marin City.

For the second year in row, Marin ranked 54th out of 57 counties in income inequality. According to the report, 197,952 of Marin’s residents have household incomes in the 80th percentile, while 35,112 residents have household incomes in the 20th percentile.

Marin also received a poor score in one of the report’s new measures: racial segregation between whites and non-white. In this category, Marin ranked 50th among 56 counties reporting.

“While there are signs of progress, we’re more vulnerable than these rankings suggest,” Willis said in a statement. “There is much more to do to achieve health equity in Marin. We need to continue to bolster programs and policies that address poverty, jobs, housing, and education.”