The question of buying a house depends on the market conditions. One has to consider the difference between rent + utilities and mortgage, utilities, insurances, taxes, and maintenance.

For example, rent: $800, and mortgage: $1200, but with other expenses, total cost: $1900.

Suppose that the house price is $270K, with $55K downpayment, and the price is appreciating at 5% annually. 

Suppose stock market is paying 10%, and mortgage interest rate is 3.5%

Over a 5 year outlook:
Net Worth with Stock Market = 80,500 + 109,904 = 190,404 - (15% capital gains) = 161K
Net Worth with House = $344,596 - 189,816 (remaining mortgage liability)  - Exit Costs (3.5%)= 142K

One of the things that is different with investment calculation today, is the leverage on the mortage. In a highly levered mortgage with low interest rate, the 5% appreciation is being earned on a very high principal amount. However, this is also a bubble situation, where incomes may not be sufficient to pay the future price.