If you are looking for affordable housing, stay away from Palo Alto, Calif.

The average price of a four-bedroom, single-family house with 2.5 baths, family room and two-car garage is $843,500.

Better to move to Oklahoma City, where you can get a similar house for $107,850.

Of course, you would have to forgo a view of San Francisco Bay for a city hundreds of miles from the nearest ocean, but how many people are willing to pay almost $1 million for a pretty ordinary house?

Apparently, a lot of people, because housing prices tend to reflect demand. Housing prices in the San Francisco area, especially in the Silicon Valley communities of San Jose, Walnut Creek, San Rafael and others, are climbing through the roof.

Housing prices in Palo Alto are the highest in the United States, according to Coldwell Banker Real Estate Corp.'s 21st annual Home Price Comparison Index, which is based on a survey of 300 markets.

The difference between Palo Alto and Oklahoma City--the most affordable in the country--is $735,650. Last year, the difference between the highest and the lowest was $711,875, an indication that housing prices are continuing to appreciate in an economic boom that appears to have no end.

"The study is demonstrative of the economic diversity in housing values across the country and the overall increase in average sales prices during 1998," said Alex Perriello, president and chief executive of Coldwell Banker, which has 3,000 franchises and 70,000 brokers and agents.

Last year, Beverly Hills, about 350 miles south of Palo Alto, had the highest average price--$812,225. Killeen, Tex., about 350 miles south of Oklahoma City, was the most affordable, at $100,350.

This year, Beverly Hills is down to No. 2 on the pricey side--$743,825--while Killeen is No. 4 on the affordable side, at $111,875.

The index was designed to give the 3.8 million American families who relocate each year for business reasons an idea of how much house they can afford in other markets, according to Gabrielle Sertich, Coldwell Banker's corporate spokeswoman.

The index evaluates the average sales prices of similar houses in "typical middle-management transferee neighborhoods," Sertich said. The house is about 2,200 square feet--the average size of a house being built today, according to the National Association of Home Builders.

Because they often have to move at a moment's notice, most transferees tend to buy new houses, according to Noelle Barbone, office manager of Weichert Realtors in West Chester, Pa., which is along the Route 202 pharmaceuticals corridor in Chester and Montgomery Counties.

Karen Orsini, who last year moved from Delaware County to Mississippi when her husband, John, was transferred, remembers buying a fixer-upper when John's job with an environmental firm took them to Hawaii.

"Hawaii was the only fixer-upper we ever bought, a real old, 1,200-square-foot one that cost us $350,000," said Orsini, who lived in the Philadelphia area for two years. "We'll never do that again. It's just miserable having to spend all the time you live there working on the house, and then having to move."

Last year's move to Mississippi was the fifth in 13 years for the Orsinis, whose houses have fit the Coldwell Banker model.

"Except for the three-bedroom, two-bath house in Hawaii, every one of our houses has been a four-bedroom, two-bath house," Orsini said. "You're always looking for an extra bedroom for a guest room or as a home office if John has to bring work home."

If you move often enough, you can get used to the wide variation in housing prices. Sometimes, the price of the new can be a vast improvement over the old price.

Joe and Michelle Harris moved to Chester County, Pa., last year from San Francisco. They had moved to the Bay Area seven years before, from Virginia.

In California, "we had to settle for a four-bedroom contemporary on a tiny lot with no yard," Joe Harris said, "and paid an unbelievable price for it.

"Here, it's just the reverse," he said. "Instead of 2,600 square feet, we wanted 3,500 square feet with a big yard that backs up on woods. We wanted a good school system, and I wanted to live within a half-hour by car to the job."

The highest average sales price for a house in the Philadelphia area meeting the survey criteria was $316,000, on the Main Line. The most affordable was in Gloucester County, at $160,963.

The area's New Jersey counties were, on average, more affordable relocation areas than the Pennsylvania counties, according to the index. Gloucester County was the most affordable in New Jersey--Bergen County, at $399,750, was the most expensive--while the most affordable area in Pennsylvania was Lancaster County, at $170,151.

Regina Coia of Coldwell Banker Caparo in Blue Bell, Pa., who handles relocation business for her company, supplies data for the survey from this area. According to Coia, the area suburbs have plenty of houses that fit the survey's bill.

She also emphasizes that the index could be used as a comparison guide for people to see how much their house would cost if it were in another area.

While it was a West Coast town that had the highest average house price, overall, the Northeast was the most expensive region, with a $240,504 cumulative average. The West followed at $207,113. The Midwest was next at $167,985, and the Southeast was next at $163,624.

According to Sertich, the average price of all housing surveyed rose about 7 percent to $231,296, compared with $216,154 last year.

The $231,250 average in Tampa came closest to the national average. In last year's survey, Burlington, Vt., at $216,176, came closest to the national average of $216,154, which had increased 5 percent over the previous year.