Hi,
I have realized a multiple linear regression.
To know how well my model does in terms of prediction, I can compute prediction
intervals bands and decide if they are narrow enough to be of use. If they are
too wide, then they probably are not useful.
So what I am trying to do is :
Theoretically I know that I can use the "predict" command in R to generate the
prediction interval for a set of points. The idea is to find the linear
regression using the lm command. Then I can use the predict command to get the
prediction interval for a set of points in the domain. Then I plot out the
predicted values as well as the upper and lower limits of the prediction
intervals for those values.
My problem is to practice what I theoretically know, especially using R.
My linear model is the following :
LinearModel.1 <- lm(GDP.per.head ~ Competitivness.score + Quality.score,
data=Dataset)
summary(LinearModel.1)
predict(LinearModel.1, se.fit = FALSE, scale = NULL, df = Inf,interval =
c("none", "confidence", "prediction"),level = 0.95, type = c("response",
"terms"),terms = NULL)
Could you please help me with my R codes ?
Thanks for your precious help,
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.