Modern Halloween celebrations focus on fun frights, but superstitions associated with the holiday’s ancestor, the Celtic festival of the dead, were no laughing matter. Families left “treats” for departed loved ones to discourage nasty “tricks” from beyond the grave.

On Halloween, 18th-century Scottish villagers drove sheep through hoops of rowan branches to protect them from ghostly mischief, including sickness.

The ritual may have arisen from observing that sheep nibbling rowanberries were healthier; the berries contain sorbic acid, which has anti-fungal properties.

Dowsers believe the forked rod or pendulum they hold vibrates as they pass over underground water, but there’s no science to support the notion. In fact, as early as the 19th century, dowsing doubters such as French chemist Michel Eugène Chevreul suggested the vibrations came from intentional muscle movements.

The German government tested 500 dowsers in the 1980s. Six “showed an extraordinarily high rate of success, which can scarcely if at all be explained as due to chance,” the study says.

In further tests, they could not replicate their “extraordinary” results. Oops.

Evolutionary biologist Kevin Foster defines superstitions as incorrect identifications of causal links.

Foster doesn’t consider “superstition” pejorative: You don’t need to understand cause to benefit from a behavior.

Believing that rustling grass always means a predator is approaching, for example, means you’ll hoof it whenever you hear the sound, whether it’s caused by wind or a hungry lion.

You’ll live to share your superstition with your children, they’ll tell their children and so on, protecting your progeny from grass-rustling lions. Foster believes that, among early humans, natural selection favored the superstitious.

Superstition can still be a plus — sort of. German researchers reported in 2010 that the more strongly participants believed in their good luck charms, the more confident they were.

The study also showed that the more confident superstitious participants were, the better they performed, perhaps due to self-efficacy — the belief in one’s ability to succeed at a specific challenge — which has been linked to how willing people are to persist at a given task.

Or maybe brains trump beliefs: In 1974, researchers in the state of Georgia found smart high school students were less superstitious than those of average intelligence.

Is superstition for the birdbrained? In the 1940s, B. F. Skinner gave eight pigeons food at fixed intervals. Between feedings, six repeated the behavior they were doing when the food first appeared, which Skinner likened to card players’ lucky rituals.

Charms or rituals may boost confidence, but an “unlucky” number can nix it. In 1993, researchers near London reported that, over a three-year period, highway traffic was lighter on Friday the 13th than on Friday the 6th. Yet, inexplicably, on the 13th, road accidents sent 52 percent more people to hospitals.

Superstition can be even uglier. In 2009, Interpol calculated the lifetime incidence of rape for South African women at 1 in 2, with nearly half of victims younger than 18, likely due to a myth that sex with a virgin can cure a man of AIDS.

Does stress create superstition? After the 1991 Gulf War, a Tel Aviv psychologist found that Israelis in cities attacked by SCUD missiles were more superstitious than residents of SCUD-free cities.

In 2008, an American study found participants more likely to perceive connections between unrelated events when first asked to recall a time when they lacked control.

In parts of Asia, many couples plan to have children during “lucky” years.