# Helmert contrasts: Each level compared to mean of subsequent levels, or mean of previous levels?

My question is what is the accepted definition of Helmert (and Reverse Helmert)?

UCLA stats define Helmert contrasts thus: "Helmert coding compares each level of a categorical variable to the mean of the subsequent levels."

However in R, ?contr.helmert tells us that "Helmert contrasts contrast the second level with the first, the third with the average of the first two, and so on. i.e each level is contrasted to the mean of preceeding levels.

Which is conventional?

One can see the purpose of each: given

levels(c("A_control", "B_goldstandard", "C_newtreatment"))


One might be interested in comparisons to all subsequent levels:

A_control = mean(B_goldstandard, C_newtreatment) # treatments are better than control?

B_goldstandard = mean(C_newtreatment) # new better than gold standard?


The "reverse" set of contrasts might also come in handy. But which is Helmert, and which is reverse Helmert?

PS: UCLA stats note that R's contr.helmert corresponds "up to a point" to what they term Reverse Helmert (otherwise known as difference coding). But that to get "proper" Helmet or Reverse Helmet, you must roll-your-own function (which I've done now, adding labels, which R doesn't offer). All very confusing.

PPS: in this very helpful post, @Glen_b notes the difference in terminology, but doesn't adjudicate.

• "Helmert coding compares each level of a categorical variable to the mean of the subsequent levels." SPSS help, too, defines it like this. And "...mean of the preceeding levels" it calls difference contrast or reverse Helmert contrast. Sep 1, 2015 at 13:43
• As @Glen_b already noted in the linked post, because the ordering of the groups is arbitrary anyway, there is no meaningful difference between Helmert and "reverse Helmert." Honestly I don't think there even is a standard for which direction to do the comparisons, I think people just pick one. Sep 1, 2015 at 13:56