DETROIT — The brick walk-up in Detroit’s North End was Chiniestka McFarland’s last choice. Someone shot a gun in the building soon after she moved in last fall. Her 2006 Ford Fusion was just stolen from the parking lot. Her kids don’t have decent playgrounds within walking distance.

But she’s so grateful not to be sleeping in a sedan, on a couch or in a shelter anymore that she often puts on her pajamas at dinnertime — as soon as she finishes work and picks up her kids.

She couldn’t relax like that in the three years she was homeless, facing daily pressure to figure out food and a place to sleep for a family.

“I am at home,” she said. “So I’m getting all my money’s worth.”

That mix of struggle and relief sums up how housing and poverty intermingle in Detroit. It’s a high-crime city with the country’s worst poverty ratenearly 1 in 3 people meet the federal definition. But Detroit also has one of the nation’s lowest rates of homelessness.

McFarland, 38, is certain she would be homeless if she lived in a city like Los Angeles. A single mother of three, she makes $12 an hour, gets some benefits for one of her children and pays $750 a month for a three-bedroom apartment. A comparable apartment in Los Angeles, if you could find one, would cost several times more than that.

The public tends to blame L.A.’s high levels of homelessness on poverty, drug use, crime or even Southern California’s warm weather.

But poverty, drug use and crime are challenges for many American cities with far fewer homeless people than L.A.

Like many of those places, Detroit doesn’t have L.A. levels of street homelessness mostly because it has more available housing.

Detroit’s flawed and somewhat accidental solution, a city rich in cheap housing and abandoned buildings, is hardly ideal. People like McFarland are often stuck in neighborhoods where they feel unsafe. Many of the homes people live in are falling apart, run by slumlords. But their availability points toward the most basic approach to getting people off the streets: finding more places to live.

“It’s pretty simple,” said Gregg Colburn, co-author of “Homelessness Is a Housing Problem: How Structural Factors Explain U.S. Patterns.” “It’s easier to get to 700 bucks a month than 2,500 bucks a month, even when you’re poor.”

Older manufacturing cities such as Milwaukee, Cleveland and Chicago have done much better at housing people than their more prosperous counterparts, even if they have been plagued by poverty and other effects of urban decay. Cold winters are not the biggest factor keeping homelessness at bay in these northern cities, according to Colburn and other researchers. It’s the old infrastructure, some of it crumbling, that has given more people access to a roof.

“One path to having low rates of homelessness is industrial decline,” Colburn said.

A driving tour through Detroit with McFarland tells that story. There’s the flat she once rented from a cousin — $500 a month for a two-bedroom portion of an old brick house with a few sections of wood missing from the front trim.

The neighborhood, known as Barton- McFarland, was the one she most coveted as a kid in the 1980s and 1990s, when she would visit family. Most families owned their own houses and held middle-class jobs. Everyone seemed to know one another.

“That’s my aunt’s house in the middle,” she said, pointing to one of many two-story homes with a small yard and driveway. “My great-grandmother lived way at the corner, but the house is torn down.”

The neighborhood declined like the rest of the city as American manufacturing tanked and white middle-class families took off for the suburbs. The city of Detroit, home to more than 1 million people in 1990, is now down to a little more than 600,000.

Civic and business leaders have tried to combat that decline with a series of downtown revitalization projects, some more successful than others. There are new breweries in shipping containers, a popular riverfront walk, restaurants with Michelin-starred chefs. But the renewal has not reached all parts of the city.

By the time McFarland moved to her cousin’s neighborhood in 2009, her cousin could no longer afford to make regular repairs. A hole in the dining room ceiling widened to let snow and rain in during the winter. She left eight years later after a falling-out that she blames partly on her own conduct.

The home is currently assessed at $25,300, about half of what a typical home in the neighborhood sold for in May, according to Redfin, the real estate listing service. Detroit’s median home sale price in June, about $75,000, is less than 10% of the median sale price in Los Angeles, $975,000, according to Redfin.

After a few minutes’ drive, McFarland arrives at one of two shelters where she once lived for three months, an unmarked cluster of brick buildings for single mothers.

She gave birth to her youngest child, 4-year-old Rylee, while staying at a second shelter, panicking after an emergency C-section because she was afraid of losing her room. She kept the room, but was not allowed to lie down during the day, she said, one of many shelter rules she found unbearable.

Her teenage son, Demetrius, who is soft-spoken and friendly, said he didn’t tell classmates where he was living and did not like when the shelter staff would yell at him just for asking questions.

As she winds through neighborhoods of houses, some well-kept, others falling apart, McFarland reaches another dwelling from her past, a corner house with a chimney, some overgrowth and a collapsing garage, next to a small yard where her children used to play.

McFarland found this four-bedroom house in 2020 — and stayed in it for a few years — after the homeless shelter helped her get a job sewing coats for homeless people at a charity called Empowerment Plan.

“I did not want to leave the house,” she said as it came into view.

She just wanted her landlord to fix the steps, which were falling in, the hole in the shower and the other hole between the kitchen and the dining room. Finally, she reported the problems to the city and left after getting evicted in retaliation, she said. She could barely afford the $850 rent, but it was still a tough decision to confront her landlord.

Detroit is full of stories like this, some much worse. Another single mother, Nateka Williams, was paying $1,200 a month for a house where the toilet appeared to be perilously close to falling into the kitchen and the basement was so moldy it was hard to breathe there. She boiled water and carried it up a flight of stairs to take a bath because the water heater didn’t work. Williams had been evicted but was hoping to get a voucher for subsidized housing at a better place.

On Friday, two months after a reporter visited, Williams said by phone that she was moving her belongings from a motel where she stayed after the eviction into a new three-bedroom house that she was renting for $900 a month. A housing group paid the security deposit and first month’s rent, but Williams would need to cover the rest, she said.

Her case manager, Tasnia Chowdhury, said the biggest issue in finding a new place is slumlords. There are plenty of cheap apartments in rough shape, but not many that she would consider habitable.

The Detroit metro area had a rental vacancy rate of more than 8%, above the national average and more than twice as high as the vacancy rate in the Los Angeles metro area, according to the most recent census data. Lower vacancy rates tend to drive up prices and keep people out of the market.

As she made her morning rounds on a recent Tuesday, Chowdhury called the city’s glut of cheap and abandoned housing a mixed blessing. On the one hand, more people have a place to stay.

The downside is people living in these dwellings — many of which are shoddy — often fail to qualify for federal housing vouchers because they are not staying on the street or in shelters.

Detroit’s homeless population, including people living in shelters, is officially under 2,000 people. Homeless people are notoriously undercounted. But even accounting for that, Detroit is in much better shape than many other cities. The city of Los Angeles, where more than 46,000 are estimated to be homeless, has about five times the number of homeless people per capita as Detroit, according to local estimates and census data.

“Given the level of poverty in Detroit — we’re one of the poorest cities in the country — we should have a lot more homelessness,” said Paul Toro, a Wayne State University professor who has studied his city’s homeless population extensively. “L.A. is not nearly so poor and they have tons of homelessness.”

Detroit’s poverty rate — 32% — is nearly double the city of Los Angeles’ 17% rate, according to census data.

Some people question whether living in slumlord housing is just as bad as homelessness. But evidence suggests there is a difference.

“Poor people have big problems,” Toro said. “Homeless people have even worse problems.”

His studies show homelessness correlates with higher levels of substance abuse, anxiety and other psychological problems. The pandemic made things worse, according to his most recent interviews, with homeless people experiencing even higher levels of stress. Those factors also cause homelessness, but it’s also likely they are made worse for people living on the streets and in shelters.

On a recent summer evening, a disc jockey was spinning records in the empty lot behind McFarland’s apartment building. Vendors sold fish sandwiches, smoothies and clothes from trucks. People were gathered around the block, smoking cigars in a new upscale bar in a retail strip.

It was one of many new touches in Detroit, which fashions itself as a comeback city.

McFarland said she loves the action from the semi-regular street parties. Sometimes she sits on her screened-in porch with the door open so she can hear; one jazz band was so infectious her baby started dancing. But on this night, she was a little too tired. She had work the next day and didn’t know how she would get there after the car was stolen.

She stayed in for the night.

Data and graphics journalist Sandhya Kambhampati contributed to this report.