Few concerns facing the United States — or any nation — are more important than ensuring children receive a first-rate education. At her confirmation hearing on Tuesday, U.S. education secretary nominee Betsy DeVos answered questions about school proficiency. Policymakers and observers disagree as to how to spend public education funds and how exactly schools should be improved. At the very least, however, most agree that school proficiency must be measured.

The nation’s education system has remained steady through poor economic times as well as policy changes. But steady is not enough and there remains considerable room for improvement.

1. Massachusetts

> Overall grade: B
> Per pupil spending: $14,081 (11th highest)
> High school graduation rate: 87.3% (13th highest)
> Pct. 3 & 4 yr. olds enrolled in preschool: 57.8% (3rd highest)

Based on a variety of measures related to school funding and academic achievement, Massachusetts earns a better grade than any other state in Education Week’s Quality Counts report. Early childhood education is important for cognitive development, and in Massachusetts, 57.8% of three- and four-year olds are enrolled in preschool, one of the highest shares of any state. Perhaps due in part to a robust childhood education program, Massachusetts has the highest share of fourth and eighth graders who are proficient in math and reading.

The state’s successes, however, are not entirely attributable to its education system. Children living in poverty face a host of challenges that can hinder educational achievement, and children growing up in Massachusetts are far more likely to grow up in a financially secure environment than most youth. Additionally, children raised by educated parents are more likely to do better in school, and in Massachusetts, 61.7% of children have at least one parent with a post-secondary degree, well above the 48.8% national average.

24/7 Wall St. reviewed education data for each state from the 2017 edition of the Quality Counts report, released annually by Education Week. The report assessed metrics in three broad categories that can determine the strength of a school system: school finances, student achievement, and environmental factors. Massachusetts schools are rated best of all states, while Nevada’s school system has the lowest score.

According to Sterling Lloyd, assistant director at the Education Week Research Center and coauthor of the Quality Counts report, the grading framework rewards states with a “well-rounded approach to education.” Broadly speaking, in states at the top end of the ranking, parents have the resources to support their children’s learning in well-funded schools; students report high academic achievement in the classroom; and graduates are able to pursue careers in an economy where opportunities are available to them.

Family income levels can play a major role in the quality of a child’s education. As Lloyd explained, “it certainly helps for parents to be able to provide stability and resources.” A child from a high-income family may enjoy greater access to books and a personal computer, as well as access to extracurricular activities that require some monetary investment. These educational tools and learning experiences are generally less available to poorer children.

In the United States, 57.2% of children are raised in households with incomes at least double the poverty level. In all but two of the states in the top half of the rankings, a larger share of children live in such households. Conversely, in only six of the 25 lower ranked states the share is greater.

Because school budgets are funded largely by property taxes as well as extensive private fundraising, a child from a high-income family is also more likely to attend school in a well-funded school district. Children attending such schools benefit from a range of additional advantages, including teachers with higher pay and greater qualifications.

By contrast, “children living in low-income areas have the resources to help them get off to a good start,” Lloyd said. Citing research indicating the benefits to all children of pre-K programs, Lloyd went on to say that “preschool can help to counteract certain disadvantages and is especially important for children in poverty.” Despite the higher stakes for low-income families, the likelihood of a child attending preschool is lower across states in which more families face financial instability.

Other socioeconomic measures, such as parental educational attainment and having fluent English speaking parents, can also have a significant bearing on a student’s chances for academic success.

To identify the states with the best and worst schools, 24/7 Wall St. used Education Week’s Quality Counts 2017 report. The report is based on three major categories: chance for success, finances, and K-12 achievement. The chance for success category includes data on family income, parent education and employment, child schooling, and employment opportunities after college. Graduation rates are defined as the percent of public high school students who graduated on time with a standard diploma for the 2014-2015 school year. All other data are for the most recent available year and are based on Education Week’s analysis of data from the U.S. Census Bureau, among other sources. The finance category incorporates metrics on cost-adjusted per-pupil spending and how equitably spending was distributed across school districts in the state in 2013. The K-12 achievement category uses 2015 test score data from the National Assessment of Educational Progress. Each category was weighted equally in determining the final ranking.

Click here to see the states with the best and worst schools.