Given a simple linear model:
N <- 10 x <- rnorm(N) y <- x + rnorm(N) firstData <- data.frame(x, y) interceptOnly <- lm(y ~ 1, firstData) linearModel <- lm(y ~ x, firstData) anova(interceptOnly, linearModel) summary(linearModel)
It is possible to predict new values from the same model:
newX <- rnorm(N) newY <- newX + rnorm(N) newData <- data.frame(x=newX, y=newY) newData$predictedY <- predict(linearModel, newData)
But how do you then evaluate the predicted values? Of course, you can put it in a new lm and say:
newLinearModel <- lm(y ~ x, newData) But I would like to use the intercept and coefficient from the original model!
Does anyone know how to produce some kind of summary / anova based on the original intercept+coefficient but calculating the error from the new data?