Should you use a home equity loan or cash-out refinance to fund your 401(k) or IRA? According to a recent study, there can be some significant advantages in doing so - but there are some hazards as well.

On the face of it, there are some great reasons to tap your home equity and put it into a tax-advantaged retirement account. To begin with, mortgage interest is tax-deductable - and so are contributions to certain retirement accounts. So you can benefit both coming and going.

In addition, current mortgage interest rates for cash-out refinancing are lower than historic rates of return for retirement portfolios and indexed annuity investments, which suggests there may be an opportunity to profit from the difference.

But should you do it?

Equity vs. investing

It would appear that's what many well-to-do, financially sophisticated homeowners do. A recent study published in the Journal of Family and Economic Issues found that homeowners with a greater share of their net worth tied up in stocks and other investments were more likely to carry high levels of mortgage debt than those with simpler finances, particularly among baby boomers.

The study, headed by Virginia Tech economist Dr. Hyrum Smith, suggested that these homeowners are making a conscious choice to keep less of their financial assets tied up in their home equity, and more in income-generating investments. In other words, rather than paying down their mortgages, they're more likely to reduce their equity through cash-out refinancing or home equity loans, and invest that money elsewhere.

IRAs, 401(ks)

You can put up to $5,000 a year into an IRA ($6,000 if you're age 50 or older) and your contribution is tax-deferred. In other words, you can deduct that $5,000 on your income taxes now and only pay taxes on it once you begin drawing on your earnings in retirement. If you have a Roth IRA, you don't get to deduct your contributions now, but your withdrawals in retirement are tax-free.

Still, $5,000 a year is a pretty small amount to be tapping your home equity for. It's much too small to justify paying the fees on a cash-out refinance and the higher interest rates on a home equity loan make the investment less attractive.

Self-employed options

On the other hand, if you're self-employed, you might consider an SEP (Simplified Employee Pension) IRA or an Individual 401(k). These allow annual contributions of up to $50,000 in 2012, with another $5,500 allowed under the Individual 401(k) if you're age 50 or over. That's more in line with the kind of money you'd do a cash-out refinance for.

Contributions to a SEP IRA are limited to 20 percent of annual income, while an Individual 401(k) can receive the equivalent of 100 percent of your annual earnings. Obviously, you're going to need some money to live on, but borrowing against your home equity can allow you to make a contribution that equals or represents a significant percentage of your earnings for the year - and is tax deductable as well.

Potential hazards

The downsides? Well, you don't have any guarantee how your investments will perform - if the stock market should go back in the tank, you could lose much of your investment and be stuck with a big mortgage bill besides.

Furthermore, you're leaving yourself exposed if you should suffer a loss of income - if your business should run into trouble, if you or your spouse should become unemployed, or if one of you should simply experience reduced hours or commissions in your present job. If that's the case, having a big home equity debt can be a burden

It should be noted that "sophisticated" investors of the type noted in the study typically have good financial resources that can help tide them over rough spots, so they don't have to worry about paying the mortgage if they experience a temporary downturn. Middle-class borrowers often don't have that flexibility, so the risk is higher.