Everyone knows the old saw that companies can do well by doing good. But many companies do more good when they are doing harm, according to a July National Bureau of Economic Research working paper on corporate social responsibility.

Researchers Matthew J. Kotchen of the Yale School of Forestry & Environmental Studies and Jon Jungbien Moon of the business school at Korea University surveyed nearly 3,000 publicly traded companies over 15 years. Their goal was to “investigate the proposition that companies engage in [corporate social responsibility] in order to offset corporate social irresponsibility.”

Kotchen and Moon found that it is bad business to be seen as an irresponsible company, but an image as a socially responsible company can to some extent be bought with public philanthropy. Surprisingly, the positive social contributions need not be in the area where the company is perceived to have fallen down on the job.

When the problem is perceptions of poor corporate governance—overpaid CEOs, say, or lack of political accountability—acts of corporate social responsibility increase, but not in the category of governance. Instead, Kotchen and Moon report, companies choose to engage in projects related to the environment, community relations, or human rights.