Hello,

The following document is _not_ about lm(), it's about creating packages 
but it includes an example that might answer to what you want, a simple 
lm() substitute. (It uses the QR decomposition, not Cholesky)

http://cran.r-project.org/doc/contrib/Leisch-CreatingPackages.pdf

Hope this helps,

Rui Barradas
Em 29-11-2012 19:58, Mohammad Ahmed escreveu:
> Help Please
> Hello,
>
> I want to find the whole hat matrix not only the hat values. Is there anyway that could be extracted from lm function ?. If not, please suggest something else.
> Direct computations using chol2inv or solve are not stable if t(X)%*%X has  high determinant. In this case lm is still able to produce correct fitted values, hat_value, residuals...etc but direct computations fail to do so. Thus I guess extracting the hat matrix from lm function will be perfect.
>
> Thank you
> 	[[alternative HTML version deleted]]
>
>
>
> ______________________________________________
> R-help@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.


	[[alternative HTML version deleted]]


