On Tuesday and Wednesday, Federal Reserve Chair Janet Yellen testified before Congress on the state of the U.S. and global economies. She said that the Fed won't raise interest rates and may slow down scheduled rate increases next year and and in 2018.

Yellen also acknowledged that the U.S. economy will probably continue its slow rate of 2% growth through 2018 and warned about the economic impact if Britain chooses to leave the European Union. And she warned that U.S. equity valuations are well above their median.

"The Federal Reserve's Monetary Policy Report concluded that 'forward price-to-earnings ratios for equities have increased to a level well above their median of the past three decades,'" according to Reuters.

The U.K. referendum on Thursday on a potential so-called Brexit and a warning about overvalued stocks are certainly ominous, but what are the takeaways for investors? The answer is that investors should be more cautious about stocks and a possible economic downturn, but there are opportunities to look at value stocks, which possess stronger fundamentals.

Like most economic experts, Yellen said that a Brexit would hurt the global economy, particularly the United Kingdom's.

A Brexit could possibly unravel the eurozone and the free-trade agreements on which globalization rests.

The good news is that polls indicate that the United Kingdom will probably remain in the EU. And if there is a clear margin in favor of remaining, then a dialogue between U.K. Prime Minister David Cameron and Europe on the future of the United Kingdom and the continent will likely occur.

Regardless of how those talks go, the disappearance of the Brexit guillotine would breathe a measure of calm into the economy.

But even if Britons vote to leave the EU, investors should stay calm and figure out how to take advantage of the situation while others panic.

European private-equity firms, such as Geneva, Switzerland-based Manixer, have been called on investors "to be careful of panic selling, even in companies which will not be that badly affected by the Brexit such as Microsoft," said Chief Executive Marwan Naja. 

TheStreet Recommends

The prevailing warnings are simply to wait and see what an actual Brexit will look like before assuming the worst.

Meanwhile, perhaps the most important thing to take away from Yellen's meeting is her warning about pricey U.S. stocks. It marks the first time in her tenure as Fed chief that she has characterized stocks as being overpriced.

Yellen's remarks could have triggered a sell-off, but investors are instead enthused that rates didn't rise. But the key takeaway is that there are undervalued stocks out there with a P-E ratios.

Zack's has a list of stocks with potential and current low P-E ratios, but two others to check out are AT&T (T) - Get Report and Allstate (ALL) - Get Report

AT&T has had a very good past year, and though it has been hurt by the recent court ruling in favor of net neutrality, it has had good dividends.

Image placeholder title

Meanwhile, Allstate beat earnings expectations last month and despite a somewhat turbulent year, has done well.

Image placeholder title

Both companies are stable, have low P-E ratios and are relatively safer in a stock market that could become more turbulent over the next few months.

But the reality is that none of us know for certain what will transpire on the political or economic scene over the next few months, and Yellen is doing the right thing by keeping the Fed cautious. Similarly, investors should remain cautious, invest in firms that they think will be secure, and wait for global and domestic economic news to improve.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.