I wish to make a contrast matrix in the case of a linear model.
I have one factor with three levels: T
, N
and A
.
I want the contrasts T
vs N
, T
vs A
and T
vs (N
and A
combined).
It is the last contrast with combined levels that cause troubles.
The "correct" result I can get by redefining N
and A
to a new combined level L
and then make a one column contrast matrix T = 1
, L = -1
.
But how to do it when this level is split into two?
The T = 2
, N = -1
, A = -1
column does not give the result of the above one col contrast.
I'm implementing it in R. The number of observations are T=30, N=14, A=15