Texas ranked No. 20 in a recently released ranking of the best and worst states for teachers, published by consumer financial service company WalletHub.

New York topped the list and Arizona ranked as the worst, according to the report, which was based on data collected from the U.S. Census Bureau, the Bureau of Labor Statistics, and the National Education Association among other institutions.

Analysts examined the 50 states and the District of Columbia, evaluating them based on salary, growth opportunities, work environment, and other factors, according to WalletHub.

Texas placed fourth in terms of opportunity and competition, according to the report. This category included average starting salaries, average annual salary, potential for income growth, average pension sizes, public school enrollment growth, and teacher tenure protections.

On the other hand, Texas ranked near the bottom (No. 46) in terms of academic and work environment for teachers. This metric scored states based on the quality of their school systems, student-to-teacher ratios, public school spending per student, annual teacher evaluation requirements, teacher union strengths, and projected teacher turnover rates among other factors.

Another factor weighing on Texas was its high turnover rate for teachers, fifth highest in the nation, according to the report.

“It is difficult for the agency to comment on a ranking where we were not part of the methodology,” Texas Education Agency information specialist DeEtta Culbertson wrote in an email. “It is important to note that recruiting, supporting and retaining teachers and principals is among the four strategic priorities of the [education] commissioner and agency.”

Rob D’Amico, communications director for the Texas American Federation of Teachers, said teachers in Texas don’t receive enough professional support, and often feel the amount of standardized testing required by the state takes instructional control from their hands.

In a separate report by WalletHub, Texas’ public school systems ranked No. 34 in terms of dropout rates, test scores, student-to-teacher ratios, and bullying incidence rates. Although Texas has the fourth lowest dropout rate, it also had the fourth lowest median SAT score.

Massachusetts ranked first in best public school system, and Louisiana ranked last, according to the report.