Beneath the U.S. stock market’s record-setting gains, trouble is stirring.

About 47 percent of stocks in the Nasdaq Composite Index are down at least 20 percent from their peak in the last 12 months while more than 40 percent have fallen that much in the Russell 2000 Index and the Bloomberg IPO Index. That contrasts with the Standard & Poor’s 500 Index, which has closed at new highs 33 times in 2014 and where less than 6 percent of companies are in bear markets, data compiled by Bloomberg show.

The divergence shows the appetite for risk is narrowing as the Federal Reserve reins in economic stimulus after a five-year rally that added almost $16 trillion to equity values. It’s been three years since investors saw a 10 percent decline in the S&P 500 and they’re starting to avoid companies that will suffer the most when the market stumbles, said Skip Aylesworth, a portfolio manager for Hennessy Funds in Boston.

“The small caps have had big runs and tend to get ahead of themselves,” Aylesworth said in a Sept. 10 phone interview. Hennessy Funds oversees about $5 billion. “It’s kind of like the tortoise and the hare, and they’re the hare. But then they get expensive, and when the market corrects, they get whacked.”

The proportion of technology companies, small-caps and newly listed stocks stuck in their own personal bear markets has risen from 30 percent in March 2013, when the overall equity market surpassed its 2007 record. S&P 500 stocks with at least 20 percent losses have fallen since then, the data show.

Market Health

Risk tolerance is declining just before Alibaba Group Holding Ltd. and its shareholders plan to sell as much as $21.1 billion of shares in what will be the biggest ever U.S. initial public offering. The price implies a $163 billion valuation, making it the third-most valuable Internet company traded in the U.S., after Google Inc. and Facebook Inc.

“How Alibaba performs will really give us an indication to the health of the market,” Malcolm Polley, who oversees $1.2 billion as president and chief investment officer at Stewart Capital Advisors LLC in Indiana, Pennsylvania, said by phone on Sept. 9. “Right now, bigger companies seem to do better. Large tech names tend to perform very well,” he said. “The bull market itself is getting rather long in the tooth. It needs to rest.”

FireEye, Potbelly

The S&P 500 ended a five-week winning streak on Sept. 12, capping a five-day decline of 1.1 percent on concern the Fed may raise interest rates sooner than anticipated. The index slipped was little changed as of 10:31 a.m. today, while the Russell 2000 lost 0.7 percent and the IPO index slid 0.8 percent today.

While rallies in Apple Inc. and Microsoft Corp. have lifted the Nasdaq Composite up about 9 percent this year, 47 percent of the measure’s stocks are in bear markets, data compiled by Bloomberg show. FireEye Inc., an online security company, sandwich seller Potbelly Corp. and World Wrestling Entertainment Inc. have tumbled more than 50 percent from their 52-week highs.

“A lot of stocks have actually made significant declines,” David James, director of research at Alpha, Ohio- based James Investment Research Inc., which oversees more than $5 billion, said by phone on Sept. 9. “Most people see the record highs on the S&P 500 and that makes them feel like, ‘Oh, the market is doing just fine,’’ without recognizing that most stocks really are not participating to that degree.”

Punch Bowl

Stocks with weak or no earnings and fewer shares to trade fare worse during market turmoil, said Brad Thompson, director of research at Frost Investment Advisors LLC in San Antonio, Texas. More than 20 percent of companies in the Nasdaq Composite and Russell 2000 will be unprofitable this quarter, according to data compiled by Bloomberg of companies with analysts’ forecasts. Only 15 companies in the S&P 500 reported a loss for the past year.

“There is a sense of ‘Well, we’ve had a lot of liquidity, we’ve had low rates,” and “once the punch bowl is taken away, the market is going to fall,’” Thompson, who helps oversee $10 billion at Frost Investment, said in a phone interview on Sept. 10. “I’m not in that camp, but that’s one narrative that’s been played out.”

Low Volatility

Low volatility across financial markets may signal investors are underestimating how quickly the central bank will raise interest rates, researchers at the San Francisco Fed said in a report last week. Bond-market indicators for long-term inflation, growth and funding costs are all lower now than they were at the end of the central bank’s first two rounds of quantitative easing.

Fed officials in their June economic forecasts predicted their target interest rate will be 1.13 percent at the end of 2015 and 2.5 percent a year later. They are set to release updated projections Sept. 17.

Dan Miller, director of equities at GW&K Investment Management in Boston, said he’s not worried about losses in some parts of the market because overall U.S. stocks are still one of the best investments. The weak performance in small caps in 2014 isn’t that bad after they surged almost 60 percent over the previous two years, he said.

“With interest rates so low and our economy in good shape, that should continue to push the stock market higher,” Miller, who helps oversee more than $20 billion, said in a phone interview on Sept. 11.

Equity Valuations

At the last market peak, losses across small-cap stocks, IPOs and technology companies were as widespread as they are today. About 45 percent of the shares were down at least 20 percent from a 52-week high in October 2007, data compiled by Bloomberg show. That compares with 18 percent for the S&P 500.

In the current bull market, speculative stocks have still delivered better returns to investors. The Russell 2000 and Nasdaq Composite are up 250 percent on average since March 2009, compared with 193 percent for the S&P 500. The IPO index has posted a smaller gain at 157 percent.

The stronger performance has led to higher valuations. Excluding unprofitable companies, the small-cap gauge trades at 20.5 times earnings. That compared with a multiple of 17.9 for the S&P 500, data compiled by Bloomberg show.

“The performance divergence is a valuation story,” Oliver Pursche, the Suffern, New York-based president of Gary Goldberg Financial Services, said by phone on Sept. 10. “As investors continue to be nervous about a correction, they’ll be more likely to sell off what they perceive to be riskier asset classes.”