WASHINGTON – The economy appears slightly healthier than many had feared it was a few weeks ago, raising hopes that it can end the year on an upward swing.

A raft of data Thursday show layoffs are trending down to a six-month low and factories in the mid-Atlantic are growing again after contracting for two months. Nevertheless, home sales fell and the housing market is expected to weigh on the economy deep into 2012.

The outlook for the final six months of the year has improved from August, when many thought the economy was at growing risk of falling back into a recession. Other recent reports showed hiring picked up slightly in September and consumers boosted their spending on retail goods by the most since March.

Most economists now expect modest growth for the rest of this year. Still, they caution that it’s unlikely to be strong enough to significantly lower the unemployment rate, which has been stuck near 9 percent for more than two years. And a recession in Europe, which many now predict, could slow growth in 2012.

Macroeconomic Advisers forecasts the economy will expand at an annual rate of 2.7 percent in the July-September quarter, and 2.6 percent in the final three months of the year. The government issues its first estimate for third-quarter growth on Oct. 27.

“A recession now looks a lot less likely, but economic growth is still going to be pretty weak,” said Paul Ashworth, an economist at Capital Economics.

Financial markets rose in morning trading after the Philly Fed report was released. They gave up most of their early gains after reports showed Europe is struggling to agree on a plan to address the region’s debt crisis. The Dow Jones industrial average closed up 37 points for the day.

Economists have been closely watching unemployment benefit applications since fears of another recession intensified last summer. Layoffs and applications tend to rise at the beginning of recessions.

“This decline in initial claims signals the potential for an improvement in the pace of job creation in October relative to recent months,” said John Ryding, an economist with RDQ Economics. “However, we are still waiting for that decisive move in claims below the 400,000 mark to send a stronger signal that payroll growth is running at a pace that will begin to make sustained inroads into unemployment.”

Job growth is critical to a housing recovery, which many economists say could be years away.

The number of Americans who bought previously occupied homes fell to a seasonally adjusted annual rate of 4.91 million homes, the National Association of Realtors said. The pace matches last year’s sales figures, which were the worst since 1997.

Economists say home sales need to be closer to 6 million to be consistent with a healthy housing market.

“This is a significant barrier to recovery,” said Ian Shepherdson, chief U.S. economist for High Frequency Economics.

Home sales are tumbling, even though mortgage rates are at record lows. This week, the average rate on a 30-year mortgage ticked down to 4.11 percent. Just two weeks ago, it fell below 4 percent for the first time.

“Housing will recover in time as the labor market picks up and people start moving around the country to take up new jobs, but for now the market is dead,” Shepherdson said.

Employers have added an average of only 72,000 jobs per month in the past five months. That’s far below the 100,000 per month needed to keep up with population growth. And it’s down from an average of 180,000 in the first four months of this year.

In September, employers added 103,000 jobs, and the unemployment rate remained at 9.1 percent for a third consecutive month.

Employers pulled back on hiring this spring, after rising gas prices cut into consumer spending and Japan’s March 11 earthquake disrupted supply chains. That slowed U.S. auto production.

Auto output has rebounded in the past couple of months and gas prices have come down from their peak in early May.

Despite the improvement, the economy faces a number of risks. Many economists now expect Europe to slide into recession by the end of this year, which could slow exports of U.S. goods and weaken growth.