I semi-regularly plug numbers into this Buy v Rent calculator by NYT [1]. They're pretty equivalent in the 10-30 year range and match housing prices I've seen.
It's hard to beat the SP500's >8% average return [2].
[1] (paywalled) https://www.nytimes.com/interactive/2014/upshot/buy-rent-cal...
[2] https://www.investopedia.com/ask/answers/042415/what-average...