+1 vote
in R Basics by

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)

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?

1 Answer

0 votes
by

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.

Related questions

0 votes
0 votes
asked Dec 30, 2019 in R Language by sharadyadav1986
0 votes
asked Dec 30, 2019 in R Language by sharadyadav1986
...