Shares of retailers and other consumer companies were more or less flat as investors rotated out of growth sectors, which have led the bull market since its inception in March, into laggards such as industrials and materials.

Despite the onset of the coronavirus pandemic, the consumer discretionary industry group on the Standard & Poor's 500 is in the green for the year to date.

It's something of a mystery why the consumer discretionary sector has been so strong when recovery for many travel and retail companies still appears to be a long way off, said Steven deSanctis, equity strategist at brokerage Jefferies.

The consumer-price index, which measures what consumers pay for everyday items including groceries, clothing and electricity, climbed a seasonally adjusted 0.4% in August, the Labor Department said.

Kroger posted a 15% increase in same-store sales as pandemic-driven demand for groceries remained strong, though executives said it had slowed from the first months of the crisis.

Shares of Peloton Interactive initially surged after the company said quarterly sales of its at-home fitness equipment more than doubled, suggesting demand from fitness buffs avoiding the gym remains strong. But Peloton finished in the red, alongside other stocks seen as benefiting from "stay-at-home" trends.

Write to Rob Curran at rob.curran@dowjones.com