I am building a quadratic model with lm in R:
y <- data[[1]] x <- data[[2]] x2 <- x^2 quadratic.model = lm(y ~ x + x2)
Now I want to display both the predicted values ββand the actual values ββon the graph. I tried this:
par(las=1,bty="l") plot(y~x) P <- predict(quadratic.model) lines(x, P)
but the line rises all excitedly. Maybe this is due to the fact that it is quadratic? Thanks for any help.

source share