The rising cost of land is one of the prime factors in the high prices of houses in the past two decades. But another factor, quality, has been coming to the fore.

Buyers of new homes have been demanding more house during the economic expansion of the past five years.

They have been asking for and getting more square footage, bathrooms, fireplaces and other amenities.

When such extras are factored out, new-home prices in the 1980s have been rising at no more than increases in consumer prices generally.

Figures compiled by the National Association of Home Builders show the median price of new homes sold this year to be about $105,000, or 14 percent more than the $92,000 median recorded in 1986.

But, the trade group notes, on a "quality adjusted" basis that discounts for greater size and more amenities, the latest price is up only 3.4 percent from the third quarter of 1986.

The term "quality," it should be noted, is used in a special sense in such measurements, referring not necessarily to a higher degree of craftmanship but to extras, including bigger lots, air conditioning and number of stories in the house.

By that reckoning, $28,700 of the $42,900 rise in new-home prices from 1982 to the first half of 1987 can be attributed to quality improvements, said Mark Obrinsky, an economist with the U.S. League of Savings Institutions.

The demand for higher quality isn't evenly distributed throughout all income and price categories. In fact, it is largely a corollary of affluence among upper-income households.

According to figures from the home builder association, two out of three new homes being built today are bought by affluent, trade-up buyers, some of whom purchased their previous homes during the late 1970s and early 1980s.

Poor economic conditions and the energy crisis in that earlier period dictated smaller, more efficient houses.

But since then, lower oil prices and high incomes have permitted some families to seek more luxurious quarters.

Obrinsky cites some of the statistical evidence: In 1986, the median square footage of all single-family homes built for sale was 1,635 square feet, a 7.6 percent increase over 1982, although still below the 1978 peak of 1,655 square feet.

More houses are now built with two or more stories than in the past -- 48 percent in 1986, compared with 35 percent in 1981.

The number of baths has increased.

In 1986, 83 percent of new houses built for sale had two or more bathrooms, compared with 75 percent in 1981.

Two-car garages are more common.

Last year, 64 percent of new houses had a garage for two or more cars. The 1981 figure was 59 percent.

Fireplaces are showing up in more new houses.

Sixty-nine percent of new houses last year had at least one fireplace, compared with 59 percent in 1981.

How badly the Oct. 19 stock market crash hurt this upper end of the housing market, if at all, cannot be ascertained this early.

Almost certainly there has been some loss of buying confidence by those hurt in the crash.

However, one of the latest indicators, an unanticipated 7.5 percent rise in November housing starts, seems to contradict that notion.