The crisis in the housing market provides an opportunity for consumers looking to snap up a bargain home. But the economy is still in dangerous territory, so many consumers may not have the financial security needed to buy a home.

Home ownership has long been viewed as an integral part of the American dream. After all, the equity you gain in your home can provide a strong platform to further your financial goals.

However, the heady days of home values doubling in 10 years are gone. In fact, median home prices nationwide are down 6.3% from last year, according to recent data from the National Association of Realtors, and more than 20% in parts of Michigan, California and Florida.

Gone, too, is the assumption that if you can afford a home, it must be a good investment.

In order to determine if it's the right time to buy, you must weigh a number of factors.

Your financial outlook for homeownership rests on the break-even point -- how long must you live in a home for the equity gains to outweigh the higher costs of home ownership.

Image placeholder title

To determine this, consider how much your home will appreciate in value and how quickly you build equity, as well as the higher costs of owning versus renting and what you could have earned by investing your money rather than using it as a down payment. The

Rent versus Buy calculator

from can help you wrap your head around some of those numbers -- and provide an estimate of how long it will take you to break even.

Essentially, the calculator compares the cost of renting with that of buying. It takes into account the particulars of your loan (the amount, interest rate, closing costs, etc), what you pay in rent and how much cash you have on hand (available either to invest or to use as a down payment).

In order to receive an accurate estimate, you'll need to provide other figures, including insurance costs, association dues, and an estimate for average returns on the money you could be investing in the stock market (7% to 8% is a reasonable estimate for long-term returns).

Say you're buying a home for $250,000. Your lender offers you a 6.26% 30-year fixed-rate loan requiring $5,000 in closing costs. You have $55,000 on hand to cover the 20% down payment and closing costs. You've got a 1.6% expected tax rate on the property, $1,500 estimated cost for homeowners' insurance, rental payments of $1,200 a month and a 25% tax bracket.

Assuming 7% return on your investment, 3.1% inflation, 2% appreciation for your home and the standard 6% sales commission (when it comes time to sell your home), then you stand to break even on your home purchase in about nine years. You can see this value on the home equity vs. investment chart presented by the calculator.

If you click on the "View Report" button below the calculator, you'll see the various pieces of this financial jigsaw puzzle.

Your monthly home payment starts out at $1,691.07 ($1,232.74 for mortgage and interest, $333.33 for property taxes and $125 for home insurance). The mortgage and interest portion of your payment won't change, but the taxes and insurance costs will rise each year to match the rise in inflation and the appreciation of your home. With the opportunity to deduct your mortgage interest payments, you also stand to save on your taxes ($4,092 in the first year if you qualify to itemize your deductions).

Your rental payment starts out at $1,200 ($491.07 less per month than your home payment), but rent goes up with inflation. By the end of 30 years, it could be upwards of $2,908.59 a month -- almost $862 higher than your final monthly home payment.

And that's not all. After 30 years, assuming the 2% rate of appreciation, you will have accumulated $425,670 in home equity. This is significantly more than the $210,167 you would have in your portfolio if you invested the $55,000 down payment and closing costs at an average return of 7%.

Over the long run, it's clear that owning in this scenario is better than buying. But if you plan to move before the nine years is over, buying may not be the right decision. Furthermore, since home prices are declining rather than rising in many parts of the country, the 2% appreciation estimate may be high, in which case it would take even longer than nine years to break even.

If you're worried about housing declines, go back and alter some of your assumptions -- including the estimated average return on investment -- in order to be sure you are comfortable with the range of break-even points that your situation may offer.

Peter McDougall is a freelance writer who lives in Freeport, Maine, with his wife and their dog.