The Washington metropolitan area is the second best place to live in the United States, surpassed only by Atlanta, according to a recently published study that rated the "livability" of 277 American cities and their suburbs.

The four-year study, called Places Rated Almanac, ranked cities according to nine categories: climate, the cost of buying and maintaining a house, health-care facilities, crime, transportation, education, recreation, the arts, and economics.

Washington was rated better than Atlanta in five of the nine categories, but Georgia's capital was rated as having the 187th best housing environment compared to 259th for the Washington area.

The survey was compiled by Richard Boyer, a Boston writer, and David Savageau, an executive with a national job placement company in Boston, who relied heavily on statistical data from federal agencies. They said they compiled the study as a guidebook for the estimated 5 million Americans who move to different states each year.

Washington and its suburbs received high marks in the arts, transportation, health care, recreation and education. The area was rated as having a better-than-average climate and a fair local economic outlook. The area's worst ratings were in the housing and crime categories.

The Greensboro-Winston-Salem-High Point area of North Carolina was ranked the third best place to live. Pittsburgh ranked fourth and Seattle fifth. Other rankings included Dallas-Fort Worth, 10th; Miami, 20th; New York City, 26th; Los Angeles-Long Beach, 47th; and Lawrence-Haverhill, an industrial area north of Boston, as 277th, the worst place to live in the nation, according to the survey. Baltimore and Richmond tied at 29th in the list.

The survey ranked each city by awarding points for services, facilities or conditions that Boyer and Savageau believe "most people would consider important to city life."

For example, the Washington area received its highest rating in the arts category. It ranked second in the nation in the arts category, earning 19,119 points. New York City was first with 42,955 points.

The points were awarded according to the size and number of cultural services in each city. The Washington area, for example, received points because the survey said it has four major universities that contribute to the area's culture (Georgetown University, George Washington University, Howard University and the University of Maryland). It also got points for the National Symphony Orchestra, the Washington Opera, the Washington Ballet, five theaters, public television, three fine arts radio stations, 94 museums (including 13 major ones) and public libraries containing 1.9 million volumes.

The survey also compares the various cultural opportunities in the Washington area with those in other communities. For example, Washington received points for having an opera company, but because the survey said the opera here only averages four productions a year and has a relatively small operating budget, Washington was not listed among the top nine cities for opera buffs. Baltimore was ranked sixth on that list because the survey said it has two companies that average eight productions a year and have larger operating budgets.

Even though the survey ranked the Washington area as the sixth worst city in the nation for congested freeways, this area ranked fifth overall in the transportation category, netting the most points for its subway system. The metro area also got points for having at least 71 trains arriving or leaving daily--including the busiest Amtrak route in the nation, the New York City-Washington run.

The Washington area ranked sixth in the nation in health care with 242 physicians per 100,000 residents, 37 hospitals, three major medical schools (Georgetown, George Washington and Howard universities) and numerous special centers, such as Children's Hospital. However, the area was listed as one of the worst for people who are allergic to ragweed and pollen.

The Washington area ranked 11th in providing recreation facilities, behind Baltimore, which was 10th. Billings, Mont., has the most bowling alleys per capita, while Eau Claire, Wis., has a neighborhood bar for every 629 residents, the lowest ratio in the nation. One of the worst cities for recreation, the survey said, was Lynchburg, Va., which has few movie theaters and bars.

Washington ranked 12th in education, according to the survey, which did not attempt to rank quality but rather gave points for the size of the school system, pupil-teacher ratio and per-pupil spending. The area ranked 56th in climate and terrain and 106th in economy.

St. Cloud, Minn., and Johnstown, Pa., were ranked as the safest cities in the nation based on crime statistics. The Washington area was ranked 228th in crime, mostly because of high robbery and burglary rates. Miami was listed as the most crime-ridden city.

The Washington area's worst rating was in housing. Scores were based on a consideration of annual utility bills, property taxes and mortgage payments. According to the survey, the prices for single-family homes in this area ranked the 13th highest. Prices of Washington homes averaged $94,348 in 1979-80. Honolulu's average home price of $169,571 ranked first, while Terre Haute, Ind., was the cheapest with an average $26,279 price tag.