And don't forget about the myriad expenses that most people don't realize are a major ongoing part of owning a house. Rarely do people factor in that a house is disintegrating daily and you need to spend serious money on a regular basis to keep it from becoming a pile of garbage.
This is the figure I always point to when people ask me why I'm not buying.
From there, you can start stacking additional costs and savings on both sides of the argument. I've done that math, too, and found that, at least in my area, that only makes buying look even worse.
That said, in a lot of places (e.g., small towns and suburbs), it's slim pickings for apartments that aren't basically bachelor pads or eyesore cookie cutter developments. If I didn't live in a major metro area, I'd probably be buying, too.