In any economic environment, it pays to keep an eye on your portfolio's diversity. And when a recession like this one strikes, you should try to figure out which sectors to favor in your holdings, and which to back away from. A new study on how recessions affect different sectors might not give us all the answers, but its findings do offer a few intriguing insights.

Research ahoy!
The McKinsey Quarterly, the online journal of global consulting firm McKinsey & Co., recently covered this topic in an article entitled "Mapping Decline and Recovery Across Sectors." The authors examined the four most recent recessions -- 2001, 1990, 1980-82, and 1973-75 -- by their impact on industry sectors.

Screening for quarterly change in revenue and EBITA (earnings before interest, tax, and amortization), the authors measured the timing of changes in financial performance for each of 10 different sectors. The researchers determined whether each sector led, lagged, was in line with, or showed no effect from the economy's slide into recession -- and its ultimate recovery. (The authors defined "no effect" as a less-than-10% decline in EBITA.)

When all was said and done, three major patterns emerged from the data.

Consumer staples
In three of the past four recessions, the consumer staples sector seemed utterly unfazed. In the lone exception, consumer staples lagged the decline, but led the recovery. Those findings suggest that consumer staple stocks could make excellent core portfolio holdings in tough times. In General Mills' (NYSE:GIS) recent results for Q2 2009, for example, diluted earnings per share fell a mere 4.4% year over year.

Name-brand businesses might not be the only beneficiaries. I've recently suggested that investors consider companies poised to benefit from the trade-down effect, too, as investors swap premium goods for less expensive alternatives. In the current environment, I think Ralcorp Holdings (NYSE:RAH) and similar stocks offer the historical stability of consumer staples -- and strong growth to boot.

Information technology
IT led the decline three out of four times. On the flipside, it only lagged the recovery once. Apparently, management considers IT spending more expendable than employees or marketing on the way down, but crucial to productivity and competitiveness on the way back up. If possible, I would prefer to go with an IT company that seems immune to cyclical economic forces. IBM's (NYSE:IBM) Q4 2008 earnings bode well for Big Blue's status as a safe haven during the downturn, and a possible upside vehicle when things turn around. That said, given IBM shares' significant volatility, I advise interested investors to accumulate shares patiently.

Consumer discretionary
Not surprisingly, this sector led the economic decline in all four recessions. On the recovery side, consumer discretionary led once, was in line twice, and lagged once. In the current quagmire, I don't think Fools should expect this sector to rebound as robustly as it has in the past. Things really might be different this time, as the security of saving takes priority over the pleasure of spending.

Accordingly, investors might want to tread cautiously with big-ticket retailers such as Coach (NYSE:COH) and Harley Davidson (NYSE:HOG). Trade-ups in the consumer staples market -- say, shoppers' return to Whole Foods Market (NASDAQ:WFMI) from Kroger (NYSE:KR) -- could more reliably indicate that the economy's regaining its footing.

The herd is your friend
The study's authors also discovered that during a recession, the behavior of share prices across sectors tends to be more similar than the financial performance of each sector. Loosely translated, the market tends to rise and fall as a unit, even as fundamentals remain differentiated.

For investors, this makes things particularly painful on the way down into recession. But when economic sentiment turns positive, history suggests that investors are able to breathe a portfolio-wide sigh of relief. Compared to the dismal returns we see now, that would be a welcome change.

Further cautiously optimistic Foolishness:

Fool contributor Mike Pienciak never once fell asleep during history class (although he did doodle). He does not own shares in any company mentioned. Whole Foods Market and Coach are Motley Fool Stock Advisor selections. The Fool has a disclosure policy.