[R] Inconsistent linear model calculations

Kingsford Jones kingsfordjones at gmail.com
Fri May 16 02:06:52 CEST 2008


Also, it's worth pointing out the reason for the numerical instability
of the parameter estimates: the predictors are nearly collinear.

> (dubious <- read.table('clipboard'))
  V1  V2    V3    V4    V5       V6     V7
1  1 300 39.87 39.85 39.90 39.87333  90000
2  2 400 45.16 45.23 45.17 45.18667 160000
3  3 500 50.72 51.03 50.90 50.88333 250000
4  4 600 56.85 56.80 57.02 56.89000 360000
5  5 700 63.01 63.09 63.14 63.08000 490000
6  6 800 69.52 59.68 69.63 66.27667 640000
> round(cor(dubious), 3)
      V1    V2    V3    V4    V5    V6    V7
V1 1.000 1.000 0.999 0.951 0.999 0.997 0.991
V2 1.000 1.000 0.999 0.951 0.999 0.997 0.991
V3 0.999 0.999 1.000 0.942 1.000 0.995 0.996
V4 0.951 0.951 0.942 1.000 0.943 0.970 0.912
V5 0.999 0.999 1.000 0.943 1.000 0.995 0.995
V6 0.997 0.997 0.995 0.970 0.995 1.000 0.983
V7 0.991 0.991 0.996 0.912 0.995 0.983 1.000


Note that the correlation for V2 and V7 is about .991


Kingsford Jones


On Thu, May 15, 2008 at 3:01 PM, e-letter <inpost at gmail.com> wrote:
> Thank you to all you eagle eyes; amendment made accordingly and solved. Not
> sure how the difference occurred...
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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.
>



More information about the R-help mailing list