3

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).

Gavin Simpson
  • 37,567
  • 5
  • 110
  • 153
Herman Toothrot
  • 249
  • 2
  • 10
  • 1
    What is the purpose of this GLM? Prediction of future values? Interpretation of the coefficients? Something else? (The answer depends on the purpose: for instance, if prediction is the only concern, both models are perfectly equivalent, so there is little to choose among them.) – whuber Oct 30 '14 at 14:10
  • 2
    @whuber I want to find if temperature drives length and if there is any relationship that at certain temperatures I can expect a certain length of a plant/animal. The field is ecology. – Herman Toothrot Oct 30 '14 at 14:48
  • @whuber is there somewhere that explains these concepts? – Herman Toothrot Oct 31 '14 at 12:38
  • @HermanToothrot While this post is a good number of years after yours, it may provide you with some answers: https://stats.stackexchange.com/questions/258307/raw-or-orthogonal-polynomial-regression – Avraham Dec 22 '21 at 19:28

0 Answers0