Two of the biggest retailers have turned in very different performances so far in 2019. Shares of Walgreens Boots Alliance (NASDAQ:WBA) are down 7% year to date, while Walmart (NYSE:WMT) stock is up by 5% in the first three months of the year. Over the past 10 years, however, Walgreens has rewarded investors with a greater return.

But which of these two stocks is the better pick for long-term investors now? Past performance doesn't matter. Instead, the decision comes down to dividends, growth prospects, and valuation. Here's how Walgreens and Walmart compare in these three key categories.

Man with hands on hips looking at a wall with arrows pointing left and right

Image source: Getty Images.

Dividends

There are two things to look at with dividends. The dividend yield is definitely important. However, you should also consider the ability for a company to continue paying its dividend and hopefully increasing dividend payouts in the future.

Walgreens clearly wins when it comes to dividend yield. The company's yield currently stands at 2.85% compared to 2.16% for Walmart. Walgreens also appears to come out on top in the sustainability of its dividend. The company uses only 31% of its earnings to fund its dividend, while Walmart's payout ratio is much higher at 92%. However, both retailers have ample cash flow to keep the dividends flowing.

Another factor that investors should evaluate is dividend growth. When companies consistently increase their dividends, it usually means that management prioritizes dividend payouts in its capital allocation strategy. Walgreens again has a distinct edge on this front as well. The company's dividend has increased by more than 30% over the past five years compared to Walmart's dividend growth of around 10% during the same period. 

Check out the latest earnings call transcripts for Walgreens and Walmart.

Growth prospects

Growth prospects are more difficult to determine. Multiple variables impact these prospects, including competitive environments, mergers and acquisitions, and macroeconomic factors. Wall Street analysts get paid to think about all of these variables. And analysts seem to like Walgreens' growth prospects better than they do Walmart's.

The average analysts' estimate for Walgreens' earnings growth over the next five years is 9.7%. For Walmart, the average estimate is only 3.5%. Are these analysts' projections trustworthy? Maybe, but maybe not.

Walgreens Boots Alliance CFO James Kehoe warned at the Leerink Partners Global Healthcare Conference last month that the pharmacy retailer faces significant reimbursement headwinds. Kehoe's comments caused Walgreens stock to fall more than 6%. His remarks also raised concerns that Walgreens wouldn't be able to meet its earnings guidance for 2019.

But while Walgreens' growth prospects look dimmer than hoped, it's a different story for Walmart. The company is actually emerging as an e-commerce powerhouse. In the fourth quarter, Walmart blew past analysts' estimates for comparable-store sales growth.

Competitive dynamics are changing for both Walgreens and Walmart. Both companies face threats from Amazon.com (NASDAQ:AMZN). However, Walmart appears to be making the right moves to survive and thrive despite this increased competition. Walgreens, on the other hand, has been somewhat dismissive in the past about the potential challenge from Amazon in retail pharmacy. 

Valuation

There are several valuation metrics that we could use to compare Walgreens and Walmart. Sometimes a stock can be more attractive than another using one valuation metric and less attractive with another metric. That's not the case here, though.

Walgreens appears to be more attractively valued no matter which metric we use. Its trailing 12-month price-to-earnings (P/E) ratio of 11.45 is way below Walmart's P/E of 43. Walgreens also looks much less expensive than Walmart using forward earnings multiples.

The comparison between the two companies is much closer using one of my favorite valuation metrics, enterprise value-to-EBITDA (EV-to-EBITDA). However, Walgreens still wins using this metric with an EV-to-EBITDA multiple of 9.38 versus Walmart's multiple of 10.47.

Better buy

All of the numbers would point to going with Walgreens Boots Alliance over Walmart. Walgreens has a stronger dividend. Analysts think its growth prospects are better than Walmart's. And Walgreens beats Walmart on valuation. But the numbers don't really reveal how a business will perform in the future. 

I think that Walmart is on a more solid footing for competing in the future than Walgreens is. Walmart has completely changed its trajectory from a few years ago and could deliver market-beating total returns in the future. In my view, it's a better pick than Walgreens Boots Alliance.

Having said that, investors don't have to choose between just these two stocks. I don't recommend Walmart as a top stock to buy for one simple reason: There are way too many stocks that have even better growth prospects. Walmart is a better buy than Walgreens, but it's not the best stock to buy.