Tucson's "quality of life" factors for retirees include recreational opportunities, such as shown here during an annual Senior Olympic Festival at the Udall Center.

A new study says Tucson has a few good things going for it as a retirement mecca — especially affordability — and several working against it.

Overall, the report prepared by WalletHub, a personal finance website, finds Tucson to be the 24th best place for retirees among the nation’s 150 largest cities. That puts Tucson ahead of Gilbert, Chandler, Glendale and Phoenix.

But the report also finds Tucson lagging far behind Scottsdale, which placed No. 5 on the list, largely because of what WalletHub calls “quality of life” issues. Peoria, Tempe and Mesa also scored higher than Tucson.

All the Arizona communities, along with those in Florida and Texas, benefit from good weather. In fact, WalletHub gives that factor more weight than anything else in the study.

The bonus points for sunshine and warmth are justified, said Richie Bernardo, a financial writer for WalletHub. These factors are a big selling point for retirees, he noted.

“A lot of the cities at the bottom of the list are in colder climates,” Bernardo said. “A lot of these people, after working decades in their professional lives, want to move down south where the climate is much more conducive to their health.”

Tucson scored fairly well overall — 14th in the nation — for all quality of life issues that WalletHub said would be of interest to seniors, including percentage of residents of retirement age who are still working; the city’s crime rate; and air and water quality.

To determine affordability, WalletHub looked at everything from the cost of living to how much someone might have to pay to get in-home services.

This is where Tucson shone, relatively speaking. It placed 58th in the nation, compared to 100th for Scottsdale.

Tucson also did not do too badly in the category of activities, such as the number of recreation and senior centers, fishing facilities and public golf courses on a per capita basis.

But the Old Pueblo lost points in health care, scoring a relatively dismal 105th place nationwide. That ranking is based on such factors as the ratio of patients to doctors, dentists, nurses and health care facilities.

Cities were scored solely on what was available within their corporate limits rather than facilities available in adjacent communities, Bernardo said. He said that is why Grand Prairie, Texas, just outside of Dallas, scored No. 2 overall, benefiting from its high ratio of medical professionals and facilities.

“By highlighting the most retirement- and wallet-friendly cities, WalletHub aims to ease the process of finding a new place to call home,” the website said in a news release.

And if you’re interested in knowing what WalletHub calls the least affordable, least retiree-friendly cities, just check out the Northeast. Providence, R.I. came in last, followed by Newark, N.J., Philadelphia and New York City.