R-beta: Polynomials in lm/glm

Matthew R. Nelson (mrn@superh.hg.med.umich.edu)
Fri, 15 Aug 1997 07:44:35 -0400 (EDT)


Date: Fri, 15 Aug 1997 07:44:35 -0400 (EDT)
From: "Matthew R. Nelson" <mrn@superh.hg.med.umich.edu>
Subject: R-beta: Polynomials in lm/glm
To: r-help@stat.math.ethz.ch
Message-Id: <Pine.3.87.9708150735.B21491-0100000@superh.hg.med.umich.edu>

R users,

I was a bit surprised to find that when I attempted to add a polynomial 
term to a linear model using either lm or glm as could be done in S 
resulted in a fit without that term included and without warning(!!), e.g.

> lm(response ~ x + x^2, data).

As far as I can gather, there is no poly() yet in R, and if lm/glm do not 
allow functions of variables as their formula arguements, is our only 
option to add variables to our dataframe before using lm/glm?

> data2 <- cbind(data,x2=data$x^2)

I did search the archive for a discussion of this topic, but did not come 
up with any discussion on this topic.  Have I missed something?  

BTW:  Version 0.50 Alpha-1 (July 22, 1997)

Thanks for any help,

Matt
----------------------------------------------------------------------------
Matthew R. Nelson
Dept. of Human Genetics         
University of Michigan              http://www-personal.umich.edu/~ticul/
4711 Medical Science II             email: ticul@umich.edu
Ann Arbor, MI  48109-0618           phone: (313) 647-3151
----------------------------------------------------------------------------


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=