[R] Linear constraints for constrasts

Serguei Kaniovski Serguei.Kaniovski at wifo.ac.at
Wed May 20 22:10:05 CEST 2009

Dear List!

How can I define contrasts (design matrix) that can all be included, 
i.e. which do not require a control category be dropped. My application 
(see below) does not suggest a sensible control category. I am thinking 
of constraining the (treatment) contrasts to sum up to zero and dropping 
the constant term in the regression. Is this a good idea? If yes, how to 
achieve this in R?

I am estimating a GLM for bilateral country data. Each observation in on 
a pair of countries, e.g. GER_USA, GER_JAP, USA_JAP. I constructed the 
following contrasts: d_GER, d_USA, d_JAP, which take the value of 1 when 
the country is in the pair and 0 otherwise, i.e.
“Bilat”, “d_GER”, “d_USA”, “d_JAP”
GER_USA, 1, 1, 0
GER_JAP, 1, 0, 1
USA_JAP, 0, 1, 1
These contrasts highlight the effect of having a given country in the pair.

Thank you for your help!
Serguei Kaniovski

More information about the R-help mailing list