U.S. stocks retreated from 12-month highs on Tuesday as disappointing housing and inflation data prompted investors to book recent gains despite strong results from bellwethers including Apple and Caterpillar.

New construction of U.S. homes rose less than expected in September and U.S. producer prices posted an unexpected decline, both pointing to an anemic economic recovery.

DuPont shares fell 2.2 percent to $33.87, making it a top drag in the S&P materials sector and the Dow industrials after the chemical maker posted higher-than-expected third-quarter profit, but revenue fell short of Wall Street estimates.

Coca-Cola Co fell 1.3 percent to $54.07 after reporting sales that also missed expectations.

Shares of companies in the materials sector declined as commodity prices fell. The Reuters/Jefferies CRB commodity index <.CRB> was off for the first time in seven sessions and crude oil settled lower for the first day in nine.

Shares of home builders also fell, with the Dow Jones home construction index <.DJUSHB> down 2.1 percent.

The market is trying to absorb all the earnings news and see where the economy stands. The market has rallied recently pretty good, so it's giving back some of the gains, said Giri Cherukuri, head trader at OakBrook Investments LLC in Lisle, Illinois.

Off the weaker housing data, people are forecasting a little bit weaker economy and that is hurting commodities, as the economy may not be as strong as previously expected.

Caterpillar Inc shares hit a 12-month high after the machinery maker's third-quarter earnings soared past expectations.

Caterpillar, up 3 percent at $59.61, was the Dow's <.DJI> best performer, even as the blue-chip index dropped 50.71 points, or 0.50 percent, to end at 10,041.48. The Standard & Poor's 500 Index <.SPX> fell 6.85 points, or 0.62 percent, to 1,091.06. The Nasdaq Composite Index <.IXIC> shed 12.85 points, or 0.59 percent, to 2,163.47.

Among other Dow components reporting on Tuesday, United Technologies Corp dipped 0.1 percent to $65.40 after its profit fell from the year-ago quarter. Pfizer Inc
fell 0.3 percent to $17.93 despite beating profit expectations.

Crude oil fell as the NYMEX November crude contract approached expiration and hurt shares of energy companies. U.S. November crude oil futures expired at the close and settled at $79.09 a barrel, down 0.65 percent, or 52 cents.

Shares of Dow components Chevron Corp and Exxon Mobil Corp fell about 0.8 percent, with Chevron at $77.03 and Exxon at $73.02.

Apple Inc posted earnings and sales that were higher than expected in quarterly results released after Monday's closing bell.

On Tuesday, brokerages lifted their price targets on the iPhone maker's stock to as much as $280, implying a gain of about 40 percent from current levels. Apple shares gained 4.7 percent to $198.76.

In spite of Tuesday's decline, the stock market's trend in the third quarter has been mostly positive. U.S. stocks have risen steadily as S&P 500 companies have largely exceeded earnings expectations.

Through noon Tuesday, with 95 of the benchmark S&P 500 companies having reported earnings, 79 percent have beaten expectations and only 11 percent have fallen behind, according to Thomson Reuters data.

Volume was moderate on the New York Stock Exchange, with nearly 1.24 billion shares changing hands, below last year's estimated daily average of 1.49 billion. On the Nasdaq, about 2.13 billion shares traded, below last year's daily average of 2.28 billion.

Declining stocks outnumbered advancing ones on the NYSE by a ratio of about 2 to 1, while on the Nasdaq, nearly three stocks fell for every one that rose.

(Editing by Jan Paschal)