I've been asked a question regarding a linear model made with R's lm:
"Did the regression use linear or non-linear iterative least squares?"
I searched a bit and [think that I] understand the difference between the two, but couldn't find any evidence of R's use of linear least squares in lm (which is the one I think it uses).
I combed throuhg lm and its underlying function lm.fit documentation, but couldn't find anything related.
I think the question I was asked is a dumb question, and it's probably wrongly formulated, but I'd appreciate any help as to how I could reply to it.
lmandlm.fitby typing their names at the command line. You could also inspect any object returned bylmto see the QR decomposition right there. – whuber Oct 08 '15 at 04:58lmdirectly tells you it fits linear models, right in the heading it says: "Fitting Linear Models". So linear, not "nonlinear". The documentation forlm.fittells you the algorithm it uses: ... ".lm.fit()is bare bone wrapper to the innermost QR-based C code". So it uses QR decomposition to calculate the least squares fit; it mentions the QR decomposition several times later in describing what's returned. What documentation did you read? – Glen_b Oct 08 '15 at 09:55