# Should I use a confidence interval or a prediction interval around the LOESS fitted curve?

A Freakonometrics blog post shows how to use a LOESS regression of the residuals of a logistic model on the predicted values of the logistic model to assess the linearity of the predictors used in the logistic regression model.

If the green interval contains zero, this indicates that the model is correctly specified (or close enough).

My question is, should I use a confidence interval or a prediction interval around the LOESS fitted curve?

I am interested in whether the estimate of $$\text{E}[y \mid x]$$ is correctly specified - so that makes me think confidence interval. However, normally prediction intervals are used for individual observations.

For reference:

Difference between confidence intervals and prediction intervals

How to calculate prediction intervals for loess

• A heuristic I find useful is to ask whether a straight line can fit through the confidence band of a nonparametric regression estimate, including LO(W)ESS: if it can a linear regression straight line estimate is probably as well-fit for the given data, if not, estimation/interpretation of a nonlinear relationship is probably warranted. – Alexis Sep 10 '19 at 16:44
• Possible duplicate of How to calculate prediction intervals for LOESS? – Alexis Sep 10 '19 at 16:45
• Yes, that is the purpose of this plot. Here the straight line is where the mode residuals= 0. It's not a duplicate, I'm not interested in how to make the prediction interval but whether to use the prediction interval or the confidence interval. – Great38 Sep 10 '19 at 18:19

## 1 Answer

You would probably use a confidence interval, since it is narrower and more conservative. Inverting null hypothesis significance testing to "confirm a null hypothesis" has innumerable practical and theoretical problems. Case in point, it's hard (impossible?) to state the actual "level" or "power" of the test, whatever you are actually testing, and one can easily liken a prediction interval to an "extra wide" confidence interval. Add to that: those points are not predictions, you have observed them, and you're interested in whether the mean response would be within a consistent range as that describes the data generating mechanism. But as pragmatic tool, I see it better to verge on the side of more false positives rather than more false negatives.

• "those points are not predictions, you have observed them" - that is actually all that needs to be said. Why would you want to calculate prediction intervals for observations? – Stephan Kolassa Sep 10 '19 at 19:26
• @StephanKolassa it's tempting to offer that as the sole explanation, but it's good to point out even then, the limits of that interval have a dubious interpretation. Equivalence testing (so that you falsify a null hypothesis of difference) requires a user to specify a margin of non-equivalence. That tiny qualifier "...or close enough" suffices to tell me that this is an exploratory exercise, and not formal. – AdamO Sep 11 '19 at 14:37