This is an oldie but goodie, pointed out by many other economists.
Which investment performs better over the long run, housing or the stock market?
Without even looking at the data, the answer has to be the stock market. That's because a home provides you a place to live, or a place that you can rent out to other people, earning rental income.
Stock ownership has no such auxiliary benefits. If the average annual rate of return for housing was, say, 5%, then the average return for stock ownership must be higher, to compensate for the fact that it doesn't directly provide you warmth and shelter. If the average return to stocks were lower decade after decade, there would be no point in investing in them.
(Of course, sometimes the whole thing gets blown out of whack, as it has the past few years. But over the long haul, the above holds true.)
Updated Shiny app
2 hours ago