Skip to content
Prev 333788 / 398506 Next

Find the prediction or the fitted values for an lm model

On Thu, 28 Nov 2013, jpm miao wrote:

            
You need to call the variable x1 because that is the name you used in the 
original data:

plot(x, predict(prodfn,data.frame(x1=x)), type = "l")
points(x1, y1)