Massachusetts once again tops the nation in an annual study intended to give an overview of the country’s health and well-being.

The Sharecare Community Well-Being Index surveyed people about their purpose, their physical, social, financial, and community well-being, and combined that data with information about economic security, home values and public transit use, as well as access to food, healthcare and public amenities.

Taken together, the index provides a snapshot of how people are thriving in their local communities.

“Where you live, work and play is indicative of your health,” said the study’s principal researcher Kimberly Ann Dukes, executive director of the Biostatistics and Epidemiology Data Analytics Center at Boston University’s School of Public Health. The school partnered with the digital health company, Sharecare, to compile the Community Well-Being Index.

“Massachusetts really has a lot of great infrastructure in place that supports members of our state,” Dukes said, noting how the Bay State vaulted to the top for two straight years.

Dukes and her 15-person team designed the two indices used in the study, which has been conducted for the past three years, but is based on a decade of data and includes some 4 million surveys. The study looked at residents across more than 3,100 U.S. counties in all 50 states to determine where people are thriving, or struggling.

The states ranking in the top five, after Massachusetts, are Hawaii, New Jersey, Maryland and New York. The bottom five states are Alabama, Kentucky, West Virginia, Arkansas and Mississippi.

Massachusetts stood out in the individual-level surveys, and got high marks in healthcare access and in housing and transportation. However, the state also ranked eighth in food access, 18th in economic security, and 26th in terms of resource access.

“Last year marked a turning point in many ways for well-being across the U.S.,” according to Dr. Michael Rickles, vice president of research at Sharecare. “As the pandemic consistently and prominently influenced the year end-to-end, from workforce dynamics to social and community engagement, our research findings underscore the fact that well-being is not an accident, but instead the result of a mix of behaviors and social circumstances that shape our lives.”

Rickles and Dukes say they hope the study informs leaders, in both the public and private sectors, to better understand the factors that combine to affect community well-being and take actions to foster healthier communities.

Produced with assistance from the Public Media Journalists Association Editor Corps funded by the Corporation for Public Broadcasting, a private corporation funded by the American people.