[R] Polynomial fitting

Jonas Malmros jonas.malmros at gmail.com
Mon Jan 7 16:15:29 CET 2008


I wonder how one in R can fit a 3rd degree polynomial to some data?

Say the data is:

y <- c(15.51, 12.44, 31.5, 21.5, 17.89, 27.09, 15.02, 13.43, 18.18, 11.32)
x <- seq(3.75, 6, 0.25)

And resulting degrees of polynomial are:

5.8007  -91.6339  472.1726 -774.2584

THanks in advance!



-- 
Jonas Malmros
Stockholm University
Stockholm, Sweden




More information about the R-help mailing list