Re: [R] Puzzling coefficients for linear fitting to polynom

2008-03-07 Thread Firas Swidan, PhD
to:[EMAIL PROTECTED] > http://www.cmis.csiro.au/bill.venables/ > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of Firas Swidan, PhD > Sent: Friday, 7 March 2008 6:16 PM > To: r-help@r-project.org > Subject: [R] Puzzling coeff

Re: [R] Puzzling coefficients for linear fitting to polynom

2008-03-07 Thread Ted Harding
On 07-Mar-08 08:16:06, Firas Swidan, PhD wrote: > Hi, > I can not comprehend the linear fitting results of polynoms. > For example, given the following data (representing y = x^2): > >> x <- 1:3 >> y <- c(1, 4, 9) > > performing a linear fit > >> f <- lm(y ~ poly(x, 2)) > > gives weird coeffici

Re: [R] Puzzling coefficients for linear fitting to polynom

2008-03-07 Thread Bill.Venables
l.venables/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Firas Swidan, PhD Sent: Friday, 7 March 2008 6:16 PM To: r-help@r-project.org Subject: [R] Puzzling coefficients for linear fitting to polynom Hi, I can not comprehend the linear fitting resul

Re: [R] Puzzling coefficients for linear fitting to polynom

2008-03-07 Thread Dimitris Rizopoulos
-- From: "Firas Swidan, PhD" <[EMAIL PROTECTED]> To: Sent: Friday, March 07, 2008 9:16 AM Subject: [R] Puzzling coefficients for linear fitting to polynom > Hi, > > I can not comprehend the linear fitting results of polynoms. For > example, given the following dat

[R] Puzzling coefficients for linear fitting to polynom

2008-03-07 Thread Firas Swidan, PhD
Hi, I can not comprehend the linear fitting results of polynoms. For example, given the following data (representing y = x^2): > x <- 1:3 > y <- c(1, 4, 9) performing a linear fit > f <- lm(y ~ poly(x, 2)) gives weird coefficients: > coefficients(f) (Intercept) poly(x, 2)1 poly(x, 2)2 4.66

[R] Puzzling coefficients for linear fitting to polynom

2008-03-07 Thread Firas Swidan, PhD
Hi, I can not comprehend the linear fitting results of polynoms. For example, given the following data (representing y = x^2): > x <- 1:3 > y <- c(1, 4, 9) performing a linear fit > f <- lm(y ~ poly(x, 2)) gives weird coefficients: > coefficients(f) (Intercept) poly(x, 2)1 poly(x, 2)2 4.66