McDonald's (MCD -0.91%) stock has been a great investment, outperforming the market's average return over the last decade. But the stock has fallen 10% since hitting a new high earlier this year. That puts its trailing-five-year return below the S&P 500.

Is the stock's dip a bad sign for this leading restaurant brand? Let's look at McDonald's recent business performance and determine whether shareholders should consider holding their shares, or whether the dip is a buying opportunity for even new investors to jump on board.

McDonald's brand is pulling in customers

Consumers have a lot on their plate, like higher interest rates and above-average inflation that are raising expenses these days. These headwinds caused consumer sentiment to fall for the fourth consecutive month, down 5% in November based on the latest consumer survey by the University of Michigan.

Wall Street is worried these headwinds will pressure sales, and indeed, that appears to be happening.

McDonald's reported a comparable-store (comps) sales increase of 8.8% year over year in the third quarter, following the 9.5% comps increase in the prior-year period and 12.7% in the year before that. Still, these are solid numbers in a challenging economy and show that the company is gaining ground on competitors.

In Piper Sandler's recent Taking Stock With Teens survey, McDonald's saw the percentage of adolescents calling it their favorite restaurant brand increase 3 percentage points to 9%, edging Chipotle Mexican Grill for the No. 3 spot. This is a sign of a business that knows how to adapt its marketing message to stay relevant with a new generation of customers, something that will be important to keep delivering returns for many years.

Why buy McDonald's stock in 2023?

If you have a long-term perspective and already hold shares, I see no reason to sell, considering the company's strong performance. You own shares of an iconic global brand that has delivered reliable returns. It also pays an attractive dividend yield of 2.47% after the recent dividend increase of 10%.

If you bought shares at a lower price years ago, the yield on your cost basis is even higher considering that McDonald's has nearly doubled its dividend over the last 10 years. Over the last year, it paid $6.08 per share.

MCD Dividends Paid (TTM) Chart

MCD dividends paid (TTM) data by YCharts; TTM = trailing 12 months.

The decision for investors new to the stock is more difficult right now, but I believe the pros outweigh the cons. The negative is that if the economy weakens further, McDonald's would probably see sales and customer traffic fall, which could hurt the stock.

During the third-quarter earnings call, management also cautioned that sales growth will continue to come down as inflation moderates, as that will bring prices down.

However, management also said that the business is performing much better than its competitors. One of the reasons is its focus on marketing and value. It credited promotions for value bundles in certain markets for the strong third quarter.

What's most impressive is that it can offer lower-priced menu items while continuing to expand margins. The operating margin reached 46% of revenue on a trailing-12-month basis through the third quarter. There are not many consumer brands that earn margins this high, which is indicative of a wide competitive moat.

McDonald's is becoming more profitable while the stock's valuation is lower, falling from a high price-to-earnings ratio of 35 a year ago to a more reasonable 24 today. This is a good reason to like the stock right now.

Another good reason is that management is still executing its Accelerating the Arches strategy to improve key areas of the business, including marketing, digital ordering, and delivery. There could be a lot more growth in store for investors, which could help this top restaurant stock resume its outperformance streak against the broader market over the next five years.