Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R programming: predict(), "prediction" vs "confidence"?

Tags:

r

learning R.... anyway:

In a simple regression just x and y, I entered:

predict(data1.lm, interval="prediction")

and

predict(data1.lm, interval="confidence")

I am confused on what the difference is.

like image 790
Travis Avatar asked Feb 23 '12 02:02

Travis


People also ask

What is the difference between prediction and confidence interval?

The prediction interval predicts in what range a future individual observation will fall, while a confidence interval shows the likely range of values associated with some statistical parameter of the data, such as the population mean.

What does predict () do in R?

The predict() function in R is used to predict the values based on the input data. All the modeling aspects in the R program will make use of the predict() function in their own way, but note that the functionality of the predict() function remains the same irrespective of the case.

How do you find the predicted value of confidence intervals in R?

To find the confidence interval in R, create a new data. frame with the desired value to predict. The prediction is made with the predict() function. The interval argument is set to 'confidence' to output the mean interval.

What is a prediction confidence?

A confidence interval of the prediction is a range that likely contains the mean value of the dependent variable given specific values of the independent variables. Like regular confidence intervals, these intervals provide a range for the population average.


2 Answers

I don't see any parameter named "interval" in the description of confint on its help page, nor in the code for either confint.default or confint.lm. I believe this may be the root of your problem.

Responding to the edit: The prediction interval is the range in which future observation can be thought most likely to occur, whereas the confidence interval is where the mean of future observation is most likely to reside. The confidence interval is generally much more narrow than the prediction interval and its "narrowness" will increase with increasing numbers of observations, whereas the prediction interval will not decrease in width. Think 'std-error-of-the-mean' (which has a 1/N term) versus 'standard-deviation' (which only has 1/sqrt(N)). In the general case, the confidence interval and the prediction intervals will be functions of the covariates rather than just individual univariate interval pairs.

like image 87
IRTFM Avatar answered Nov 02 '22 16:11

IRTFM


interval is an argument of predict, not confint.

The intervals can include the uncertainty on the estimated coefficients (confidence), the variance ("noise") in the observations, or both (prediction).

like image 37
Vincent Zoonekynd Avatar answered Nov 02 '22 16:11

Vincent Zoonekynd