[R] Using lm with quadratic term

K Fernandes kafernan at uwaterloo.ca
Thu Jan 20 03:20:22 CET 2005


Hello,
I would like to use lm to model the equation y=x^2.

However, when I use

z<-lm(formula=y~x^2)
summary(z)

I obtain results that are equivalent to when I use 

z<-lm(formula=y~x)
summary(z)

That is, using x instead of x^2.

However, I do get different results when I use

z<-lm(formula=y~log(x))
summary(z)

Does anyone know why this might be the case?  Any ideas are appreciated.

Thank you,
K




More information about the R-help mailing list