[R] lm output
daniel at umd.edu
Fri Oct 9 23:24:13 CEST 2009
That comes out as an NA because X'X is not invertible because it is not full
rank (one row/column is a linear combination of the other(s)). And that
means there is no unique solution to the system.
Therefore, nope, there is now way to make this come out as a zero, because
it fails the very assumptions of regression analysis.
cuncta stricte discussurus
Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Im
Auftrag von Brecknock, Peter
Gesendet: Friday, October 09, 2009 5:12 PM
An: r-help at r-project.org
Betreff: [R] lm output
I am running a linear regression using the lm object.
In the event that my independent variable is the same across all
observations the regression slope is returned as an NA.
For example, if I have the following
lm = lm(y~x)
produces the following
Other than post-processing the results, is there a way to output the slope
as 0 rather than NA?
This e-mail may contain confidential or proprietary information belonging to
the BP group and is intended only for the use of the recipients named above.
If you are not the intended recipient, please immediately notify the sender
and either delete this email or return to the sender immediately. You may
not review, copy or distribute this email. Within the bounds of law, this
part of BP retains all emails and IMs and may monitor them to ensure
compliance with BP's internal policies and for other legitimate business
[[alternative HTML version deleted]]
R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help