Skip to content
Back to formatted view

Raw Message

Message-ID: <1204878694.26892.6.camel@localhost.localdomain>
Date: 2008-03-07T08:31:34Z
From: Firas Swidan
Subject: Puzzling coefficients for linear fitting to polynom

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.6666667   5.6568542   0.8164966 

However the fitted() result makes sense:

> fitted(f)
1 2 3 
1 4 9 

This is very confusing. How should one understand the result of
coefficients()?

Thanks for any tips,
Firas.

-- 
Firas Swidan, PhD
Founder and CEO
Olymons: Blessing Machines with Vision (TM)
http://www.olymons.com
P.O.Box 8125
Nazareth 16480
Israel
Cell: +.972.(0)54.733.1788