I\'m trying the next code to try to see if predict can help me to find the values of the dependent variable for a polynomial of order 2, in this case it is obvious y=x^2:
If you read the help for predict.lm, you will see that it takes a number of arguments including newdata
predict.lm
newdata
newdata -- An optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used.
predict(mypol, newdata = data.frame(x=7))