The cost of housing is high, but things really are not as bad as they seem -- or at least not as bad as they are labeled by the federal government.

That's the conclusion of U.S. Housing Markets, a report on housing conditions published by Advance Mortgage Corp. of Detroit.

Housing Markets contends there was actually an improvement in housing affordability last year over 1979 because of "a flattening in house prices" that counteracted a steep increase in mortgage-interest rates.

The government, which reported a sharp rise in housing costs, is accused of basing its figures on a homeownership index -- a part of the consumer price index used to calculate housing costs -- so flawed that its widely reported conclusions are far out of line.

The homeownership index "overstated last year's rise in total home-ownership costs by some 75 percent and it exaggerated last year's gap in housing affordability," Housing Markets reported.

Housing Markets compiled an index of its own that it said reflects a more accurate state of housing affordability. It shows an average increase of 9 1/2 percent in homeownership costs for the year ending in September 1980. The figure compares with the government's finding that homeownership costs increased by 16.8 percent in the year.

The problem, Housing Markets said, is that the government is basing its findings mostly on figures derived from homes financed with standard loans of the Federal Housing Administration, which reflect less than 10 percent of the total market.