I am working with this data set:
u <- c(31,63,95,117,127,143,151.5,157) v <- c(98.5,103.8,107.5,101,85,63,34.3,14)
u <- c(31,63,95,117,127,143,151.5,157)
v <- c(98.5,103.8,107.5,101,85,63,34.3,14)
I want to fit a model to these data so that u = f(v). I want it to be a 3rd order polynomial model.
How can I do that in R?
To get a third order polynomial in x -
model<- lm(v~ poly(u,3))
Or
model<- lm(v~ u+ I(u^2) + I(u^3))
poly(u,3) is preferable.
Hope this answer helps.