Consumer prices rose 0.4 percent last month with higher prices for shelter, new cars and clothing accounting for much of the increase, the Labor Department reported yesterday.

The seasonally adjusted increase in the consumer price index was double the 0.2 percent rise in September but was in line with the average monthly increase this year. In the past 12 months, the CPI rose 4.5 percent, and in the past three months was up at a 4.2 percent annual rate.

White House spokesman Marlin Fitzwater said, "The rate of inflation remains under control despite the increase we experienced at the beginning of the year." The CPI went up at a 5.3 percent rate in the first quarter and at a 4.9 percent rate in the second.

Allen Sinai, chief economist at Shearson Lehman Bros. Inc. in New York, said, "The report doesn't show runaway inflation by any means. But it was disturbing because the increases were so broad-based and for the obvious impact of the lower dollar."

Prices of some consumer goods imported from abroad are rising more rapidly than those produced domestically because the value of the dollar has dropped substantially relative to some key foreign currencies, including those of the Japanese yen and most Western European countries. When the dollar goes down, a foreign producer earns less in terms of his own currency from sales in the United States at a given price in dollars. If the foreign producer incurs his costs in his own currency, either he has to raise the sales price in dollars or accept a lower profit margin.

"I think we'll see more of {dollar-related inflation}," said Cynthia Latta, a senior economist for Data Resources Inc. "I think the dollar's decline has been large enough now that many exporters are going to have to pass on higher prices to U.S. consumers."

Higher prices for imports probably were a factor in the big 1.3 percent increase in the apparel portion of the CPI last month. That jump came on the heels of a 1.1 percent increase in September and left prices up 6.1 percent, compared with October 1986.

While apparel prices were flat or falling during the summer, a similar increase occurred last spring. In both cases, the biggest increases were for women's and girls' clothing.

However, some other significant price increases did not involve foreign goods. Shelter costs went up 0.5 percent last month, largely because of a sharp 0.9 rise in the "rental equivalent" cost of owner occupied housing.

Most other housing costs went down or rose very little. Fuel and other utilities fell for the second month in a row. They were down 0.7 percent last month and 0.5 percent in September. Costs of household furnishings and operation also fell, as did renters' costs. The cost of maintenance and repairs rose 0.1 percent.

The transportation portion of the CPI rose 0.5 percent after going up 0.2 percent in September. Much of the October increase was due to a 0.6 percent jump in new car prices. However, new car prices rose only 3 percent in the past 12 months.

Medical care prices increased 0.4 percent last month, slightly less than the 0.5 percent rise in September. That portion of the overall index was up 6.2 percent in the past year.

Grocery store prices rose 0.3 percent, only half as much as in September, leaving that part of the index up 3.4 percent in the past year. The only large rise in October was for fruits and vegetables, which went up 1.3 percent after a 2.2 percent jump a month earlier.

The October increase left the CPI at a level of 345.3, which meant that a market basket of goods and services that cost $100 in 1967 last month cost $345.30.