I am setting up a GLM in R where I have only one predictor variable and its quadratic form. I understand that in R I have 2 options.
glm(y~x+I(x^2), family = gaussian) # non-orthogonal polynomial
glm(y~poly(x,2), family = gaussian) # orthogonal
How do I determine the best way of fitting the data? Is there a preferred choice because x^2
is correlated to x
, and what are its implications?
All the variables involved are continuous, x
is temperature and y
is length and each sample has a unique pair (x,y)
.