Autor des Abschnitts: Danielle J. Navarro and David R. Foxcroft

Verschiedene Möglichkeiten, Kontraste zu definieren

Im vorangegangenen Abschnitt habe ich Ihnen eine Methode zur Umwandlung eines Faktors in eine Sammlung von Kontrasten gezeigt. In der Methode, die ich Ihnen gezeigt habe, geben wir eine Reihe von binären Variablen an, indem wir eine Tabelle wie diese definieren:

drug

druganxifree

drugjoyzepam

placebo

0

0

anxifree

1

0

joyzepam

0

1

Each row in the table corresponds to one of the factor levels, and each column corresponds to one of the contrasts. This table, which always has one more row than columns, has a special name. It is called a contrast matrix. However, there are lots of different ways to specify a contrast matrix. In this section I discuss a few of the standard contrast matrices that statisticians use and how you can use them in jamovi. If you are planning to read the section on unbalanced ANOVA later on (section Faktorielle ANOVA 3: unbalancierte Designs), it is worth reading this section carefully. If not, you can get away with skimming it, because the choice of contrasts does not matter much for balanced designs.

Behandlungskontraste (treatment contrasts)

In the particular kind of contrasts that I have described above, one level of the factor is special, and acts as a kind of “baseline” category (i.e., placebo in our example), against which the other two are defined. The name for these kinds of contrasts is treatment contrasts, also known as “dummy coding”. In this contrast each level of the factor is compared to a base reference level, and the base reference level is the value of the intercept.

The name reflects the fact that these contrasts are quite natural and sensible when one of the categories in your factor really is special because it actually does represent a baseline. That makes sense in our clinicaltrial data. The placebo condition corresponds to the situation where you do not give people any real drugs, and so it is special. The other two conditions are defined in relation to the placebo. In one case you replace the placebo with Anxifree, and in the other case your replace it with Joyzepam.

The table shown above is a matrix of treatment contrasts for a factor that has three levels. But suppose I want a matrix of treatment contrasts for a factor with five levels? You would set this out like this:

Level   2 3 4 5
  1     0 0 0 0
  2     1 0 0 0
  3     0 1 0 0
  4     0 0 1 0
  5     0 0 0 1

In this example, the first contrast is level 2 compared with level 1, the second contrast is level 3 compared with level 1, and so on. Notice that, by default, the first level of the factor is always treated as the baseline category (i.e., it is the one that has all zeros and does not have an explicit contrast associated with it). In jamovi you can change which category is the first level of the factor by manipulating the order of the levels of the variable shown in the Data Variable window (double click on the name of the variable in the spreadsheet column to bring up the Data Variable view).

Helmert-Kontraste

Treatment contrasts are useful for a lot of situations. However, they make most sense in the situation when there really is a baseline category, and you want to assess all the other groups in relation to that one. In other situations, no such baseline category exists, and it may make more sense to compare each group to the mean of the other groups. Helmert contrasts, generated by the Helmert option in the jamovi ANOVAContrasts selection box, compare each group to the mean of the “previous” ones. That is, the first contrast represents the difference between group 2 and group 1, the second contrast represents the difference between group 3 and the mean of groups 1 and 2, and so on. This translates to a contrast matrix that looks like this for a factor with five levels:

1   -1   -1   -1   -1
2    1   -1   -1   -1
3    0    2   -1   -1
4    0    0    3   -1
5    0    0    0    4

With Helmert contrasts, every contrast sums to zero (i.e., all the columns sum to zero). This has the consequence that, when we interpret the ANOVA as a regression, the intercept term corresponds to the grand mean µ.. if we are using Helmert contrasts. Compare this to treatment contrasts, in which the intercept term corresponds to the group mean for the baseline category. It does not matter very much if you have a balanced design, which we have been assuming so far, but it will turn out to be important later when we consider unbalanced designs in section Faktorielle ANOVA 3: unbalancierte Designs. In fact, the main reason why I have included this section is that contrasts become important if you want to understand unbalanced ANOVA.

Kontraste, die sich zu Null aufsummieren

The third option are “sum to zero” contrasts, called Simple contrasts in jamovi, which are used to construct pairwise comparisons between groups. Specifically, each contrast encodes the difference between one of the groups and a baseline category, which corresponds to the first group:

1   -1   -1   -1   -1
2    1    0    0    0
3    0    1    0    0
4    0    0    1    0
5    0    0    0    1

Ähnlich wie bei den Helmert-Kontrasten sieht man, dass jede Spalte Null als Summe ergibt, was bedeutet, dass der Interzept-Term dem Gesamtmittelwert entspricht, wenn die ANOVA als Regressionsmodell behandelt wird. Bei der Interpretation dieser Kontraste ist zu beachten, dass es sich bei jedem dieser Kontraste um einen paarweisen Vergleich zwischen Gruppe 1 und einer der anderen vier Gruppen handelt. Genauer gesagt, Kontrast 1 entspricht einem Vergleich „Gruppe 2 minus Gruppe 1“, Kontrast 2 entspricht einem Vergleich „Gruppe 3 minus Gruppe 1“ und so weiter.[1]

Optionale Kontraste in jamovi

jamovi can generate different kinds of contrasts in an ANOVA. The following contrast types are available in the drop-down menu Contrasts of the ANOVA analysis panel:

Kontrasttyp

Was vergleicht der Kontrast?

Abweichung

Vergleicht den Mittelwert jeder Ebene (außer einer Referenzkategorie) mit dem Mittelwert aller Ebenen (Gesamtmittelwert).

Einfach

Wie bei den Behandlungskontrasten wird auch beim einfachen Kontrast der Mittelwert jeder Stufe mit dem Mittelwert einer bestimmten Stufe verglichen. Diese Art von Kontrast ist nützlich, wenn es eine Kontrollgruppe gibt. Standardmäßig ist die erste Kategorie die Referenz. Bei einem einfachen Kontrast ist das Interzept der Gesamtmittelwert.

Differenz

Vergleicht den Mittelwert jeder Stufe (außer der ersten) mit dem Mittelwert der vorherigen Stufen (manchmal auch umgekehrte Helmert-Kontraste genannt).

Helmert

Vergleicht den Mittelwert jeder Stufe des Faktors (außer der letzten) mit dem Mittelwert der nachfolgenden Stufen.

Wiederholt

Vergleicht den Mittelwert jeder Stufe (außer der letzten) mit dem Mittelwert der nachfolgenden Stufe.

Polynomial

Vergleicht den linearen Effekt, den quadratischen Effekt, usw. Der erste Freiheitsgrad enthält den linearen Effekt über alle Kategorien, der zweite Freiheitsgrad den quadratischen Effekt, usw. Diese Kontraste werden häufig verwendet, um polynomiale Trends zu schätzen.