[R] Constrain coefs. in linear model to sum to 0

From: Gorjanc Gregor <Gregor.Gorjanc_at_bfro.uni-lj.si>
Date: Mon 07 Aug 2006 - 18:37:16 EST


Hello!

I would like to use constrain to sum coeficients of a factor to 0 instead of classical corner contraint i.e. I would like to fit a model like

lm(y ~ 1 + effectA + effectB)

and say get parameters

intercept

effectA_1
effectA_2
effectB_1
effectB_2
effectB_3

where effectA_1 represents deviation of level A_1 from intercept and sum(effectA_1, effectA_2) = 0 and the same for factor B.

Is this possible to do?

Lep pozdrav / With regards,

    Gregor Gorjanc


University of Ljubljana     PhD student
Biotechnical Faculty        URI: http://www.bfro.uni-lj.si/MR/ggorjan
Zootechnical Department     mail: gregor.gorjanc <at> bfro.uni-lj.si
Groblje 3                   tel: +386 (0)1 72 17 861
SI-1230 Domzale             fax: +386 (0)1 72 17 888
Slovenia, Europe

"One must learn by doing the thing; for though you think you know it,  you have no certainty until you try." Sophocles ~ 450 B.C.

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon Aug 07 18:47:44 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 07 Aug 2006 - 20:18:32 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.