Comparing the quality of governance between states can be challenging. The decisions state governors, legislators, city mayors and other elected officials make can have wide-reaching effects on state residents, and these decisions can sometimes take years to have an impact.

Aware of these inherent challenges, 24/7 Wall St. has for seven straight years reviewed the outcomes and conditions of every state in the country, ranking each based on finances as well as social and economic indicators. This year, for the fifth year in a row, North Dakota ranks as the best run state in the country. For the second consecutive year, New Mexico ranks worst.

22. Maryland

> Debt per capita: $4,392 (13th highest)
> 2015 Unemployment rate: 5.2% (tied-25th highest)
> Credit rating: Aaa/AAA
> Poverty: 9.7% (2nd lowest)

Median household income in Maryland is $75,847 a year, more than $20,000 above the typical American household income and the highest among all states. Also, as is often the case in high-income states, Maryland’s poverty rate is low, with just 9.7% of the population living below the poverty line. Unlike many affluent states, Maryland has not leveraged its wealthy tax base into a balanced budget. Among the factors dragging down the state’s rank is the relatively high state debt as well as one of the highest foreclosure rates in the United States. Maryland’s debt amounts to 59.0% of the state’s annual budget, and an estimated 1 in every 62 houses in the state are in foreclosure, more than double the national foreclosure rate.

There is no comprehensive measure of how well or poorly a government runs a state. Our basis for this ranking consists of measures of financial health and fiscal responsibility, as well as socioeconomic outcomes such as unemployment, poverty, and crime — conditions state governments are tasked with managing and improving.

Selecting appropriate criteria to compare 50 states is difficult because governing does not occur in a vacuum. Each state has different populations, obstacles, and means with which to work. Some states are more rural, while others are highly urbanized and densely populated. Some states depend disproportionately on one industry, while economies in other states are more diverse. Some states rely on high-skilled sectors, such as technology and business services, while others are rich in natural resources.

These circumstances can have a meaningful impact on where they rank in our list. North Dakota’s economy, for example, experienced a boom a few years back due to the explosive development of the Bakken shale oil formation. The consequent population and employment growth helped result in extremely low poverty and unemployment rates, and helped propel the state higher in the rankings.

The very resources that help some states can become a burden to those that are overdependent on them. The massive decline in global oil prices from the second half of 2014 through 2015 has taken a serious toll on state oil revenues. Should prices persist at these low levels, the socioeconomic benefits from the oil boom in these states may soon evaporate.

While some states’ economic fortunes are closely tied to the rise and fall of individual industries, which are often outside of the government’s control, each state must make the best of its own situation. Governments, as stewards of their own economies, need to prepare for the worst, including the collapse of a vital industry. Good governance is about balancing tax collection and state expenditure in a way that provides essential services to residents without sacrificing a state’s long-term fiscal health. Setting aside a rainy day fund and not incurring too much debt, for example, are ways to plan for the worst.

For a majority of states, the bulk of government revenue comes from taxes. To ensure a healthy tax base, states can create grants, subsidies, and incentives to encourage the growth of businesses in the region. Some of the best run states on our list have a high share of workers in professional, scientific, and financial jobs, which tend to be higher-paying.

The best run states also have growing populations, with many new residents likely attracted by educational and occupational opportunities. The best run states often attract the wealthiest, most educated residents, and, with the resulting tax revenue, can continue to promote smart economic development.

Rank State Debt per capita Unemployment rate Credit rating Poverty rate
10 Oregon $3,620 5.7% Aa1/AA+ 15.4%
9 Washington $4,407 5.7% Aa1/AA+ 12.2%
8 Colorado $3,103 3.9% Aa1/AA 11.5%
7 Texas $1,524 4.5% Aaa/AAA 15.9%
6 Iowa $2,031 3.7% Aaa/AAA 12.2%
5 Utah $2,446 3.5% Aaa/AAA 11.3%
4 Wyoming $1,586 4.2% No GO debt/AAA 11.1%
3 Nebraska $1,007 3.0% No GO debt/AAA 12.6%
2 Minnesota $2,882 3.7% Aa1/AA+ 10.2%
1 North Dakota $2,493 2.7% Aa1/AA+ 11.0%

Click here to see the best and worst run states in America: a survey of all 50.