Polynomial Regression in R

January 16, 2010

If you find yourself trying to do a polynomial regression in R, you may find Polynomial Regression in R by Bret Larget extremely helpful. I always have a hard time remembering the I(x^2) syntax. The explanations of the underlying statistics are also useful if you already know a little bit of what’s going on.

While r2 has this nice interpretation, its major deficiency is that it will always increase as you add additional variables — the residual sum of squares from a small model must be at least as large as that from a larger model of which it is a special case. So, looking at r2 is not a good strategy for picking out a good model, because you can get increasingly better r2 values by addiing spurious variables. One attempt to correct for this is to compute the adjusted r2 statistic.

Comments Off on Polynomial Regression in R