Re: [R] Problems with lm()

From: Daniel Malter <>
Date: Mon, 07 Jul 2008 20:42:32 -0400

If that is so, i.e. x1=-x2, then they do not convey different meaning and cannot be estimated. Think about it that way you leave the house 8 hours after midnight. This is identical to saying that you leave the house 16 hours before midnight. This conveys the exact (!) same information and neither measure is better than the other. Therefore you do not gain anything by including both. You need variation in the measures so that both can be meaningfully estimates. Be aware though that even if there is variation, but when this variation is marginal, then your model may suffer from
"multicollinearity" and you may find "weird" results (e.g. unexpected,
"crazy" coefficients; "wrong" signs on your coefficients; insignificance
when you would expect significance). Then excluding one of the regressors may still be necessary because despite their variation (i.e. x1 is slightly different from -x2), the difference in information convey by them is marginal. Multicollinearity violates the model assumptions of OLS.


cuncta stricte discussurus

-----Ursprüngliche Nachricht-----
Von: [] Im Auftrag von Chibisi Chima-Okereke
Gesendet: Monday, July 07, 2008 8:09 PM
Betreff: [R] Problems with lm()

Dear all,

I am trying to fit a multiple linear regression model to a table of data. My data.frame is like this ... <- data.frame(y, x1, x2, x3, x4, x5, x6), then I use the linea regression command ...

lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6, data =

however, for some tables the data in column x1 is equal to -x2, so I get NA values for both coefficients of x1 and x2. I need to have real fitted coefficients for all the parameters or the physical meaning of the parameters is lost. Is there any way of forcing R to fit all the parameters? I have seen the contrast option but I don't really understand it (I am not a statistician) so I would be greatful if anyone could explain that.

Kind Regards


        [[alternative HTML version deleted]] mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Tue 08 Jul 2008 - 00:46:34 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 08 Jul 2008 - 11:31:09 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive