# Confused about sum and treatment contrasts

I'm currently studying for an Experimental Design exam. I feel like I'm missing something quite fundamental...

I've attached a minimal example to illustrate my confusion at https://gist.github.com/2942913

We were asked to compare the treatment and sum dummy coding systems. It was pointed out that with the treatment system the values in the "contrast matrix" [1] do not correspond with the observations in the data matrix (or the design matrix). My cbind() command in the example illustrates this. [2]

Using the sum coding system, the contrasts are negative for one value of the factor and positive for the other (and they also don't change when leaving out the interactions). This is supposed to result in "interpretable parameters" (as opposed to the treatment coding system?). My question is how I should interpret this last statement, i.e. why does having a correspondence between the contrast and data matrix with the sum coding result in interpretable parameters? Or: is there something I urgently need to revise?

[1] $( X' X)^{-1} X' )$

[2] Edit (replacing original footnote): There was a 'bug' in the code I provided caused by the following. I used cbind() with a factor (essentially only for presentation purposes; to show the vectors side by side). This resulted in an implicit conversion of the numerical codes in the factor to numbers.

• (+1) If only for your username. Hilarious. – cardinal Jun 17 '12 at 14:04
• That's the first time any of the usernames I ever made up elicits such a reaction! :-) – contr.error Jun 17 '12 at 15:49

The short answer to your question is that treatment or 'dummy' variables sum to 1 for each observation row. In the sum coding system the variable, representing the same thing, sum to 0 for each observation row.

The second part of your question, how is sum coding related to interpretable parameters; I would rephrase the question to how does sum coding give useful information about the response or independent variables.

That being said, I think both forms of dummy coding give us interpretable parameters. I think the class is asking, in what circumstances is it preferable to use sum coding instead of treatment coding.

An example from my research experience when sum coding was used instead of treatment coding: We wanted to know if the amount of campaign funds donated to a House member changed when that House member belonged to a political party with majority status. If the House member belonged to a political party that lost majority status they were coded -1 for that column. If the house member gained majority status they were coded +1 for the same column. Over the two terms studied, the house member in each row had dummy variables summing to 0.

If we had used treatment coding it would have the dummy variables per row would have summed to 1.

When you get into the math of a multiple regression the sign associated with a dummy variable affects the coefficient since that dummy is multiplied by all other independent variables in addition to the dependent variable.