While much attention has been given to soaring stock prices the past few years, homeowners have done extremely well. According to

The State of the Nation's Housing: 2000

, a study produced by Harvard's

Joint Center for Housing Studies, "the value of primary residences climbed 20.5% from $7.8 trillion in 1995 to $9.4 trillion in 1998, while the value of stocks owned by households nearly doubled from $3.8 trillion to $7.4 trillion."

The surge in home prices is great news for those of us who believe that real estate can be an attractive investment vehicle. But wait, as TV ads say, there's more: A good argument can be made that residential real estate investment gains are significantly higher.

Did real estate returns rival those of the stock market? During the past decade, the stock market has enjoyed enormous growth. But if we are to have something close to an apples-to-apples comparison, we cannot discount or ignore the shelter value of real estate or the way realty profits are treated.

If we go from property worth $7.8 trillion to prime residences valued at $9.4 trillion, the difference is $1.6 trillion, or 20.5% But homeowners did not pay $7.8 trillion for their houses -- at least not in cash. Typically, they put down some money and borrowed the rest.

According to the National Association of Realtors' biannual

buyer/seller survey, a median home buyer was likely to put down 10% of the purchase price when buying a home -- 3% for first-time purchasers and 19% for repeat buyers.

If folks bought property worth $7.8 trillion, we might reasonably expect that $780 billion would be cash and the balance would be in the form of financing. If the value of this initial investment of $780 billion grew to $2.38 trillion in total ($780 billion plus $1.6 trillion), then the real increase would be 205%.

Yes, the entire stock of U.S. housing didn't turn over in a single year, but then it's equally true that stock sold in 1998 may have been bought well before 1995.

Let's say a home buyer put down $10,000 in cash to buy a $100,000 house. A few years later, the home is sold for $120,500. In general terms -- not counting closing costs or loan amortization -- at settlement the owner has a credit of $120,500, less the $90,000 mortgage. The $10,000 initial investment now becomes a check to the owner worth $30,500, a 205% increase. (Of course, closing costs and the like add a chunk to your initial investment.)

But what about the amount that was borrowed to finance the home purchase? How do we account for that?

Residential real estate, the place where you and I live, can be seen as both an investment and as shelter. If our cash downpayment represents the money needed to acquire the property -- our investment -- then our monthly costs for mortgage interest, principal, taxes and insurance can be seen as the cost of lodging. For the sake of this exercise, such costs are rent. (If we didn't own, we would surely want to live somewhere, which means we would pay rent to a property owner.)

Think about it this way: You buy a stock for $10 a share and the value (hopefully) increases to $15, you're now ahead 50%. That's great, but what else can you do with the certificates you hold? You certainly can't use a mound of stock certificates for shelter -- though in some cases after recent declines, they may be valued for BTUs.

Even if the returns from securities and real estate were entirely even, residential real estate profits can be significantly more valuable than stock market earnings.

Imagine we have $1,000 in stock profits and $1,000 in profits from the sale of a prime residence. The dollar amounts are the same, but stock market profits are taxed by Uncle Sam and most states.

Sell a home you've lived in for two of the past five years, and the tax treatment is different. The feds and most states will look the other way. Under

Internal Revenue Service

rules, the first $250,000 in profits ($500,000 for married couples) are not taxed.

At this point, stock brokers and analysts will quickly mention that securities can be bought on margin. True, but how much stock is bought on margin and how many margin accounts allow purchases with 3% down or with 125% financing? Not a lot.

No less important, what happens if the value of stock bought on margin falls? You might get a hasty call from your friendly stockbroker demanding that you chip in more cash or liquidate your holdings.

But if the value of a home falls, mortgage lenders won't ask for more money or threaten to foreclose. Just make your monthly payments and everyone will be happy.

Now, this doesn't mean investors should dump their stock investments and buy up a bunch of homes. But, it does show that a home can provide many happy returns.

Peter G. Miller is the author of The Common-Sense Mortgage (Contemporary Books) and hosts consumer real-estate site

Ourbroker.com.