It is not hard to see why. Most negative advertisements in judicial elections attack candidates as soft on crime.

The new study was commissioned by Lambda Legal, which litigates cases on behalf of lesbians, gay men and bisexual and transgender people, and was conducted by Anthony Michael Kreis, a professor at Chicago-Kent College of Law, and two colleagues. They looked at 127 decisions from state Supreme Courts since 2003, when the United States Supreme Court struck down a Texas law that made gay sex a crime.

That is not a particularly large number of decisions. They addressed various legal questions, and they gave answers at various times in a period of rapid change in public attitudes on gay rights. And methods of selecting judges are not evenly distributed around the nation.

But the results lined up predictably: the more political the selection mechanism, the less support for gay rights. State Supreme Courts whose justices were elected in partisan elections supported gay rights 53 percent of the time. The number grew to 70 percent for nonpartisan elections, to 76 percent for retention elections and to 82 percent for appointed systems.

The difference between systems that relied on partisan elections, where judges run as Republicans or Democrats, and all others was statistically significant, the study’s authors wrote.

In an interview, Professor Kreis said the findings concerning partisan elections may reflect the added element of political primaries, which can reward candidates who take positions that are more attractive to a party’s base than to the general electorate.

Timing matters, too. Other studies have shown that judges seeking re-election start ruling differently as Election Day approaches.