qr.coef(qr, y) qr.fitted(qr, y) qr.resid(qr, y) qr.qty(qr, y) qr.qy(qr, y)
qr.qy and qr.qty return the results of the matrix multiplications: Q %*% y t(Q) %*% y Conj(t(Q)) %*% y (in the complex case) where Q is the order-nrow(x) orthogonal (or unitary) transformation represented by qr.
The QR decomposition used does not return an explicit orthogonal (or unitary) matrix. For reasons of accuracy and efficiency, an indirect representation of the decomposition is used.
Thisted, R. A. (1988). Elements of Statistical Computing. Chapman and Hall, New York.
reg0 <- lsfit(x,y) coef1 <- qr.coef(reg0$qr, y1) # different y, same x