The decision is really surprisingly multi-dimensional and, no, most people don't even scratch the surface of it. I thought this calculator was brilliant a decade ago, and my opinions hasn't changed.
https://www.nytimes.com/interactive/2014/upshot/buy-rent-cal...