One thing this seems to ignore -- a mortgage gives you _leverage_ for an investment. Is any bank going to loan you hundreds of thousands of dollars to invest in the S&P?
The NYTimes/NerdWallet calculators implicitly account for that in their logic - they track money you gain/lose from down payment/mortgage/interest/taxes, then selling the house at the end.
On the renting side, they only assume investing the money that isn't going to down payment/monthly mortgage payments, not investing the full value of the house.
My blog post here is just giving an argument that 2 of their parameters should be updated, then showing the result of that update.
Usually these kinds of calculations take that into account. E.g. the up front investment in the stock market == the downpayment on the house. But remember that you're paying for that leverage with interest, which further eats into your gains on the house.
On the renting side, they only assume investing the money that isn't going to down payment/monthly mortgage payments, not investing the full value of the house.
My blog post here is just giving an argument that 2 of their parameters should be updated, then showing the result of that update.