the ROI for stocks would have to be significantly higher than the ROI from real estate for it to make sense for a working/middle class person to invest in stocks instead of the structure they live in. you need to pay for housing either way.
The insane levels of year-over-year appreciation/rent hikes make any calculator say "buy" in expensive major cities, regardless of the difference in cost today.
Citation needed. That's not the case in the SF Bay Area, Manhattan/Brooklyn, Vancouver, or Toronto. The new tax bill's provisions to cap mortgage interest deductions has further tilted the balance against expensive houses.