[R] lm coefficients

About this list Date view Thread view Subject view Author view Attachment view

From: Timur Elzhov (Timur.Elzhov@jinr.ru)
Date: Wed 04 Feb 2004 - 03:25:53 EST


Message-id: <20040203162553.GA2938@nf034.jinr.ru>

Dear R experts,

Excuse me if my question will be stupid...
I'd like to fit data with x^2 polynomial:

d <- read.table(file = "Oleg.dat", head = TRUE)
d
  X T
  3720.00 4.113
  3715.00 4.123
  3710.00 4.132
  ...

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,
yes?

T1 <- 9.803 -108.075 * d$X + 51.007 * d$X^2
T1
  705453240
  703557595
  701664500
  699773956
  ...

So, T1 obviosly gets non-sensible values.. :( Why?
Thanks a lot!

--
WBR,
Timur.

______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 01 Mar 2004 - 07:05:08 EST