I think you want:
glm(y ~ x + I(x^2), ...)
This is shown as an example on pg 50 of "An Introduction to R"
(R-2.2.0-pdf).
HTH,
--sundar
Jeffrey Stratford wrote:> R-users,
>
> I'm having some trouble getting .glm and glm.nb to run a polynomial.
> I've used x*x and x^2 and neither works. I've checked out the
archives
> and they refer to an archive that's no longer working.
>
> I've seen that they use poly() but I'm following up my analysis
with
> cv.glm so I'd prefer to keep using glm. It's easier to just add a
> column to my data but I'd rather code it.
>
> Thanks for the response... I appreciate the people that work on the
> list.
>
> Jeff
>
> ****************************************
> Jeffrey A. Stratford, Ph.D.
> Postdoctoral Associate
> 331 Funchess Hall
> Department of Biological Sciences
> Auburn University
> Auburn, AL 36849
> 334-329-9198
> FAX 334-844-9234
> http://www.auburn.edu/~stratja
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html