# Helmert

**Helmert contrasts.** Compares
categories of an independent variable with the mean of the subsequent
categories. The general matrix form is

```
mean (1/k 1/k ... 1/k 1/k 1/k)
df(1) ( 1 -1/(k-1) ... -1/(k-1) -1/(k-1) -1/(k-1))
df(2) ( 0 1 ... -1/(k-2) -1/(k-2) -1/(k-2))
. .
. .
df(k-2) ( 0 0 ... 1 -1/2 -1/2)
df(k-1) ( 0 0 ... 0 1 -1)
```

where *k* is the number of categories
of the independent variable. For example, an independent variable
with four categories has a Helmert contrast matrix of the following
form:

```
(1/4 1/4 1/4 1/4)
( 1 -1/3 -1/3 -1/3)
( 0 1 -1/2 -1/2)
( 0 0 1 -1)
```