I have a confession to make. In the midst of the market's turmoil over the past five months, I managed to forget something from Investing 101: Picking the right industry can be just as important as picking the right company. But the recent Amphenol (NYSE:APH) earnings release reminded me of that basic lesson.

Amphenol is part of the somewhat nebulous diversified electronics industry, which covers everything from coaxial cables to medical diagnostic equipment. And on looking further at this diverse industry, I found a surprisingly resilient group of companies. That's potentially good news, because, as I see it, a good company may be more likely to turn into a top-performing stock if its peers and competitors are also strong companies.

Earnings and the future
Amphenol's earnings fell slightly last quarter to $0.53 per share. That's not bad, considering analysts were expecting only $0.50.

At the same time, though, the company also gave earnings guidance for next quarter. Coming in at $0.39 to $0.41 per share because of softer demand, the news didn't live up to analyst expectations of $0.44.

The company's warning got me thinking about what earnings and margins should be for the typical stock in this industry. Digging up that information was a real eye-opener -- this entire group has remained attractive in a generally unattractive environment.

A jury of one's peers
If we really are in the throes of a recession, somebody forgot to tell these companies about it.

Looking more closely at the industry, I gathered fundamental data for all of the major stocks in the group, removing those focused on solar power or audio recording. This left behind what should be a list of organizations truly described as diversified electronics makers.

The group I picked includes Molex (NASDAQ:MOLX), Tyco International (NYSE:TYC), Tyco Electronics (NASDAQ:TEL), and WMS Industries (NYSE:WMS), along with Amphenol.

Company

Operating Margin

Net Margin

Trailing P/E

Forward P/E

Molex

10.6%

6.1%

11.6

15.8

Tyco Elec.

14.2%

12%

4.2

7.9

WMS

17.3%

10.8%

19.1

13.5

Tyco Int'l

10.8%

7.7%

6.6

8.4

Amphenol

19.5%

13%

10.7

12.4

Average

14.5%

9.9%

10.4

11.6

All historical data provided by Reuters; forward-looking P/E data provided by Thomson via Yahoo! Finance.

Yes, you can find industries with lower P/E ratios. But few boast any margin for error when it comes to earnings and profit margins. While cheap stocks are everywhere right now, it's tough to find that perfect combination of low valuations, strong margins, and growth prospects. .

With top margins and five-year estimated future growth of 17%, Amphenol justifies a slightly higher P/E than the industry's norm in my mind. I'd be willing to hold any of these stocks, but if I were looking for something new right now, Amphenol would be my pick.

Semi-related reading for fellow Fools: