BEND, Ore. (CNN/Money) -
If you own a home, it's probably safe to assume its value has gone up these past few years.

In fact, between 1997 and 2002, the median price increase for single-family homes in America was 51 percent, according to data from Fiserv CSW. Yet, there are big variations from one part of the country to the next, even from one zip code to the next.

Prices in the 94621 Oakland, Calif., zip code, for example, jumped 164 percent over that period. On the other side of bay in Palo Alto's 94306 zip, home values rose 74 percent. And across the country in West Bloomfield, Mich., prices rose just 24 percent. (see a list of America's hottest zip codes here)

What gives?

There are three main factors that affect the value of your house -- in this order: the overall economics of your area, the location of your house within that area, and the specific traits of your house.

"The biggest influence on home values is supply and demand," said Robert Irwin, author of "How to Get Started in Real Estate Investing" and several other real estate books.

But while the macro economy is one of the largest influences on home values, for most people it's pretty unrealistic to base buying and selling decisions on big-picture economics.

In some respects, it's like trying to time the stock market, said CSW senior economist David Stiff. "Because you can't control or predict macro issues, the best way to protect yourself is buy a house that's a good value within its area," said Stiff.

First, choose your neighbors

Location, location, location. "It's what most drives values," said Walter Carpenter, president of the appraisal firm Pinel & Carpenter. "That's where people start their buying decision."

In fact, unless you think you've found the next up-and-coming neighborhood, experts say you're better off (at least from an investment perspective) buying a lesser house in a better neighborhood than buying the best house in a lesser neighborhood.

"Appraisers call it the principal of progression," said Ray Brown, coauthor of "Home Buying for Dummies." He added, "If you buy the least expensive house in the neighborhood, the value around you drives up your property."

Of course, the opposite is true. If yours is the grandest house in the neighborhood, its value will be pulled down by the lower value of houses around it. "You'd be a fool to buy the most expensive house on the block and then put money in it," said Brown.

OK, so what makes a neighborhood desirable? It's not always predicated on logic, said Warwick, R.I., realtor Ron Phipps. "There are just some areas known to be more expensive."

Although, the quality of schools is a bit of a chicken-or-egg scenario (What came first: good schools or high home values?), it is one indicator of future home values. For that reason, Irwin recommends researching local schools even if you don't have children. "You can trace the course of a neighborhood with how the schools have done," said Irwin.

The length and nature of the commute is also a driving force behind values. "In areas where commuting is an issue, housing located in the inner areas will appreciate at a higher rate," said Carpenter. Second to no commute is an easy commute. For example, the value of homes in Providence, R.I., shot up when a regional (or commuter) train began between Boston and Providence, said Phipps.

Other positive influences on property values include amenities like shops and restaurants, recreation areas and -- last by not least -- views.

Then choose your house

Although general location is the most important influence on property values, experts say there are still plenty of house-specific characteristics to keep in mind. If buying the cheapest house on the block means buying a house with an "incurable" problem, consider another neighborhood.

"There's a street in Rhode Island where the houses on one side back up to a forest, and the houses on the other side back up to power lines and a freeway," said Phipps. Obviously, there will always be a large discrepancy in prices.

Looking beyond power lines, your home's location within a neighborhood is an important value factor, according to Irwin. Corner lots, for example, may not appreciate at the same rate as the rest of the neighborhood if they have traffic on both sides and less yard. Flag lots, which have no street access other than the driveway (the flag pole), are also a tough sell.

The architectural style and layout of a house also affects values. Houses that aren't in keeping with local architecture often don't appreciate as well, said Phipps. Odd layouts also dampen home values. "A house with lots of small rooms may not do as well as one with larger rooms," said Phipps. "People like open floor plans."

All things being equal, a house with quality finish work will appreciate better. In fact, buyers are increasingly forgoing more square footage if it means better quality. Buyers, say experts, now scrutinize everything from kitchen counters and cabinets to the thickness of the molding.

"Appointment and trim features in houses are very important today," said Carpenter. "You now see people demanding more interesting architectural features."