I try a model on whatsoever data :
$ \ln \mu_i = \beta_0 + \beta_1 t_i $
and then compare it with :
$ \ln \mu_i = \beta_0 + \beta_1 t_i + \beta_2 t_i^2$
For the first model I wrote in R :
general_reg = glm(cases ~ year, family = poisson)
and I was told to write the second model :
general_reg = glm(cases ~ year + I(year^2), family = poisson)
I don't understand why writing the following gives the same as the first model :
general_reg = glm(cases ~ year + year^2, family = poisson)
Can someone explain it to me please? I write on cross validated because it is a statistics question even thought I focus on the code. Let me know if you think I am wrong.
polyfunction. For raw polynomials, usepoly(x, 2, raw = TRUE)and for orthogonal polynomials use the defaultpoly(x, 2). Orthogonal polynomials have some benefits, as discussed here. – COOLSerdash Feb 24 '20 at 15:22Rmanual page forformula, it's purely a matter ofRsyntax. – whuber Feb 24 '20 at 16:39