Legalizing same-sex marriage would reduce San Francisco's health and welfare costs because married people are healthier and wealthier than singles, and would generate revenue for government from a surge in weddings, the city's chief economist testified Thursday at the trial of a lawsuit challenging California's Proposition 8.

Edmund Egan's testimony was the first attempt by the plaintiffs - two same-sex couples and the city of San Francisco - to assess the economic effects of the November 2008 ballot measure that amended the state Constitution to define marriage as the union of a man and a woman.

The couples, two Burbank men and two Berkeley women, have already testified about the effect Prop. 8 had on their lives by frustrating their hopes to marry. The plaintiffs are trying to show that the measure has also caused financial harm, strengthening their claim that it was irrational and thus must have been motivated by unconstitutional bias against gays and lesbians.

"Married individuals are healthier, on average, and behave in healthier ways than single individuals," Egan, who heads the Office of Economic Analysis in the city controller's office, testified in U.S. District Court in San Francisco.

That translates into lower worker absenteeism, greater productivity, higher wages and more payroll taxes, he said. Married people also are less likely to need health care and are more likely than single people or domestic partners to be covered by insurance, in which case the city doesn't have to subsidize their care, Egan said.

He also said lesbians and gays now use "a disproportionately high level" of drug and alcohol treatment programs, "and one reason is discrimination."

Research showing that married people are more likely than singles to accumulate wealth suggests that allowing same-sex marriage would increase spending on consumer goods, Egan said.

He said it was impossible to put dollar figures on the city's projected savings in those areas. But Egan offered estimates of the revenue San Francisco would receive from same-sex weddings and ran into tough questioning from a lawyer for Prop. 8's sponsors.

The city could expect $1.7 million a year in added sales taxes and $900,000 in hotel taxes from wedding-related spending and out-of-town visitors, the economist said.

Egan said the figures were projections based on the more than 4,100 gay and lesbian weddings performed in the city from June 2008, when a state Supreme Court ruling legalizing same-sex marriages took effect, and Nov. 4, 2008, when Prop. 8 passed.

Peter Patterson, lawyer for Protect Marriage, the Prop. 8 campaign committee, said Egan had greatly overstated the measure's impact.

The 2008 figures reflected a "pent-up demand" for same-sex weddings that would surely decline, Patterson said during cross-examination. He noted that there was a sharp drop in gay and lesbian marriages in Massachusetts in the second year after they were legalized there.

Patterson questioned Egan's assumption that married same-sex couples would be less likely to incur health care costs than unmarried partners, saying the economist had based his statement on studies of heterosexual couples. Those studies were irrelevant to a "gay-friendly city" like San Francisco, Patterson said.

He also noted that same-sex domestic partners are entitled under state law to the same insurance coverage as spouses.

Egan replied that the pre-Prop. 8 burst of San Francisco weddings exceeded expectations that were based on the Massachusetts figures. He said they would probably continue at an elevated level, at least in the short term, if the law changes.