I have a data set where I want to compare different treatments with a certain baseline. So I basically have a linear model (ANOVA) like this:
outcome = b_0 + sum_i(b_i * x_i)
with b_i the fitted parameters and x_i dummy variables or contrasts. Now I have two ways I can code my dummy variables:
1) default dummy coding
for treatment k: x_k = 1, x_i = 0 for i!=k
for baseline: x_i = 0 for all i
in this way, I obtain:
b_0 = mean(outcome(control))
b_i = mean(outcome(treatment_i)) - mean(outcome(control))
2) (non-orthogonal) contrasts to explicitly compare treatments with baseline
for treatment k: x_k = 1, x_i = 0 for i!=k
for baseline: x_i = -1 for all i
in this way, I obtain:
b_0 = mean(outcome(all)) = "grand mean"
b_i = mean(outcome(treatment_i)) - "grand mean"
So, although I expected the second coding to be the one that explicitly compares treatments with the baseline (by having a "-1,1" contrast for each treatment) [*], it actually compares treatments with the grand mean, which I don't want.
I see that I will have to use option 1), but I am confused by the fact that the contrasts actually don't do what I expect them to do. So what is wrong with my reasoning in option 2)?
[*] (edit to clear things up a bit): This reasoning was coming from the book "Discovering Statistics Using R" from Andy Field. There, he gave a nice recipe to define "contrasts" using weights:
Rule 1: Choose sensible comparisons. Remember that you want to compare only two chunks of variation and that if a group is singled out in one comparison, that group should be excluded from any subsequent contrasts.
Rule 2: Groups coded with positive weights will be compared against groups coded with negative weights. So, assign one chunk of variation positive weights and the opposite chunk negative weights.
Rule 3: The sum of weights for a comparison should be zero. If you add up the weights for a given contrast the result should be zero.
Rule 4: If a group is not involved in a comparison, automatically assign it a weight of 0. If we give a group a weight of 0 then this eliminates that group from all calculations.
Rule 5: For a given contrast, the weights assigned to the group(s) in one chunk of variation should be equal to the number of groups in the opposite chunk of variation.
A bit further in the book, he explains that non-orthogonal comparisons can also be done with the same recipe, but by simply disobeying rule 1 in the recipe above.