Nearly 100 female economists say a peer or a colleague has sexually assaulted them. Nearly 200 say they were the victim of an attempted assault. And hundreds say they were stalked or touched inappropriately, according to a far-reaching survey of the field.

The results, compiled by the American Economic Association, also reveal deep evidence of gender and racial discrimination within the field. Half of the women who responded to the survey said they had been treated unfairly because of their sex, compared with 3 percent of men. Nearly half of women said they had avoided speaking at a conference or a seminar to guard against possible harassment or “disrespectful treatment.” Seven in 10 women said they felt their colleagues’ work was taken more seriously than their own.

More than 9,000 current and past members of the association, both men and women, took part in the survey. And the results have jolted the group’s leaders, who announced several measures on Monday to combat harassment and discrimination.

The moves include the appointment of an ombudsman empowered to investigate complaints of misbehavior by economists, and the threat of professional sanction — including the potential loss of prestigious awards — for economists who are found to violate a new anti-harassment code.