class: center, middle ## IMSE 440 ## Applied Statistical Models in Engineering
## Simple linear regression ## Confidence & prediction intervals [ISLR book](https://www.statlearning.com): Chapter 3.2.2 --- # Why do we develop statistical models? - Make inferences - Is there a relationship? - How strong is the relationship? - Which variable(s) are of most importance? - Is there synergy among variables? -- - Make predictions - What is the predicted sales in a new market if we spend 150 in TV ads? - How confident are we with the predictions? --- # Making predictions Once we developed a model (i.e., estimated the model parameter from data), we can make predictions with $$\hat{y}=\hat{\beta}_0+\hat{\beta}_1x^*$$ $$\text{where $x^*$ is any given value.}$$ .center[] --- .center[] What is the 95% confidence interval of the .red[average] sales for .red[all] markets that have a TV budget of 150? --- # How confident are we w/ the predictions? $$\small{ \begin{aligned} \hat{y}&=\hat{\beta}\_0+\hat{\beta}\_1 x^\* \\\ \\\ \hat{Y}_{mean}&=\hat{B}\_0+\hat{B}_1 x^\* \\\ \end{aligned} } $$ -- Previously, we showed the sample .red[slope] estimator $$\small{ \begin{aligned} \hat{B}\_1&=\frac{\sum (x\_i-\bar{x})Y\_i}{S\_{xx}} \\\ \hat{B}\_1&\sim \text{N}(\beta\_1, \frac{\sigma^2}{S\_{xx}}) \end{aligned} } $$ The sample .green[intercept] estimator $$\small{\hat{B}_0}=\bar{Y}-\bar{x}\hat{B}_1$$ --- $$\small{\hat{B}_0}=\bar{Y}-\bar{x}\hat{B}_1$$ $$\small{\text{E}[\hat{B}_0]=?\;\;\;\;\text{var}(\hat{B}_0)=?}$$ --- $$\small{\hat{Y}_{mean}=\hat{B}\_0+\hat{B}_1 x^\*}$$ --- # CI for the mean response at $x=x^*$ $$\small{ \begin{aligned} \\\ \hat{Y}\_{mean}&=\hat{B}\_0+\hat{B}\_1 x^\* \\\ \\\ \text{E}\big[\hat{Y}\_{mean}\big]&=\beta\_0+\beta\_1 x^* \\\ \\\ \text{SE}\big(\hat{Y}\_{mean}\big)&\approx\text{RSE}\sqrt{\frac{1}{n}+\frac{(x-\bar{x})^2}{S\_{xx}}} \\\ \end{aligned} }$$ -- The CI for the mean response at $x=x^*$ is $$\small{\hat{\beta}\_0+\hat{\beta}\_1 x^* \pm t\_{\frac{\alpha}{2}, n-2}\cdot}\text{SE}\big(\hat{Y}\_{mean}\big)$$ --- .center[] A new market is opening next month. It has a TV budget of 150. What is the 95% confidence interval of the predicted sales of this particular new market? --- # Prediction interval (PI) A confidence interval for a .red[single, particular] response at $x=x^*$
$$ \begin{aligned} \hat{Y}&=\hat{B}\_0+\hat{B}\_1x^\*+\epsilon \\\ \\\ &=\hat{Y}\_{\text{mean}}+\epsilon \end{aligned} $$