[R] lm diagnostics and qr (fwd)

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Jun 26 18:20:43 CEST 2003


On Thu, 26 Jun 2003, Jean Eid wrote:

> I have been struggling to find some informaation on what lm exactly does.
> I know it uses the QR decomp. However, I was recently faced with a
> somewhat badly scaled matrix and summary(lm) said
> 	Coefficients: ( 4 not defined because of singularities)
> does anyone know how lm chooses these 4 coef. is it forward building of
> the model --> drop last when qr sends a non full rank design matrix?

It is forward building of the QR matrix (not the same thing), and it 
pivots (to last) columns that it does not add.  It's in the source code, 
file src/appl/dqrls.f.

[...]

> Lastly, the qr function is supposed to take the LAPACK package in its

Supposed by whom?  That's not what the help page says.

> default but it seems to default LINPACK. The following appears only when
> qr(x, LAPACK=T)
> attr(,"useLAPACK")
> [1] TRUE

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list