Message-ID: <Pine.A41.4.58.0402030902300.107162@homer04.u.washington.edu>
Date: 2004-02-03T17:04:12Z
From: Thomas Lumley
Subject: lm coefficients
In-Reply-To: <20040203162553.GA2938@nf034.jinr.ru>
On Tue, 3 Feb 2004, Timur Elzhov wrote:
> Dear R experts,
>
> Excuse me if my question will be stupid...
> I'd like to fit data with x^2 polynomial:
>
<snip>
> out <- lm(T ~ poly(X, 4), data = d)
> out
> Call:
> lm(formula = T ~ poly(X, 2), data = d)
>
> Coefficients:
> (Intercept) poly(X, 2)1 poly(X, 2)2
> 9.803 -108.075 51.007
>
> So, d$T best fitted with function
> 9.803 -108.075 * X + 51.007 * X^2,
No. The predictors are not X and X^2, but two orthogonal polynomials.
Look at the help page for poly().
-thomas