I am trying to fit smooth curve to my dataset; is there is any better smoothing curve than I produced using the following codes:
x <- seq(1, 10, 0.5)
y <-
You've got 19 points, so a polynomial up to X^18 will bullseye each of your points:
> xl=seq(0,10,len=100)
> p=lm(y~poly(x,18))
> plot(x,y)
> lines(xl,predict(p,newdata=data.frame(x=xl)))
BUT that's ignoring what statistics is all about. Its about acknowledging that curves won't fit through points. Its about finding a model with a small number of parameters that explains as much as it can about the data, and leaves only noise. Its not about spearing your points with a curve - a curve so drawn has very little meaning between the data points.