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.