From 2013-2015, there was a spike in initial public offerings, and some investors have struck it rich in the process. That, however, doesn't mean you should jump into the IPO game headfirst. In fact, Warren Buffett says you should avoid IPOs at all costs.

Buffett's warning
As anyone who has followed Buffett's stock purchases over the years can see, the Oracle of Omaha is not a big fan of investing in IPOs. In fact, he seems them as an unnecessary gamble. As he said at Berkshire Hathaway's (BRK.A 0.63%) (BRK.B 0.83%) recent annual meeting, "You don't have to really worry about what's really going on in IPOs. People win lotteries every day..."

Sure, some people have gotten rich by investing in IPOs over the past several years. For example, brave investors who bought into the Spark Therapeutics IPO in Jan. 2015 are sitting on a 56% gain in less than a year and a half. However, investors have been just as likely to see much of their investment dollars vanish into thin air, as we'll see when we look deeper into the numbers shortly.

Buffett reminds investors that just because a strategy works for one investor doesn't make it a good idea. "If they want to do mathematically unsound things and one person gets lucky... it's nothing to worry about," Buffett said. "You don't want to get into a stupid game just because it's available."

A look at the numbers
Taking a look at recent IPO statistics, it's hard to argue with Buffett's logic. According to a report by Renaissance Capital, out of the 170 IPOs that priced in 2015, 57% finished the year below their offer price.

And while the year-end average performance of -2% might not sound too bad, consider that this is based on each IPO's issue price, not the price it actually trades for on its first day on the market. Ignoring the first-day pop that happens with the majority of IPOs, the actual "aftermarket" return of 2015 IPOs was a dismal -13.5% by year end.

As I mentioned, there were some high points like Spark Therapeutics. Shake Shack was another example of an IPO that produced big profits for investors. However, many recent IPO investors probably wish they had their money back.

Consider that investors who bought shares of GoPro's highly anticipated IPO on its first trading day are down more than 59% as I write this. Peer-to-peer lender Lending Club was expected by many to be the next big thing in the financial industry, but shares are down 66% since going public a year and a half ago. First-day investors in handmade goods marketplace Etsy have seen about 71% of their investment dollars evaporate.

ETSY Chart

Now, it's important to mention that none of these are "losses" unless investors sold their shares, and it's entirely possible that all three of these stocks could rocket back past their respective IPO prices. That's not the point. Rather, it is that it's better to wait until a company has been public for some time in order to be able to properly evaluate its business and its obstacles to profitability. For example, I happen to love Etsy's business model, and believe that the company will ultimately be successful. However, I'd much rather buy shares at the $9 or so the market has decided it's worth as opposed to the upper-$20 range it traded for in its first few weeks as a public company.

The bottom line
Another piece of advice Buffett likes to give investors is: Don't think like you're buying stocks at all. Instead, approach an investment like you're buying the business. In other words, buy a stock because you like the underlying business fundamentals, not because you think the stock will go up. And in the case of most IPOs, the business can be quite difficult, if not impossible, to properly evaluate.

So, while IPOs can be fun to track and read about, if you're serious about investing for the long run, it's best to stick to tried-and-true stocks that represent businesses you would want to own.