Lecture Overview:
- What could go wrong? (Ch. 3)
- Linearity of Regression Function
- Assumptions on error terms
- Unusual Observations
What Could go Wrong? (Ch. 3)
- We don’t know in advance whether the model is appropriate.
- It’s important to examine the aptness of the model before making inferences.
- Model: The model structure is correct $E(Y)=\beta_0+\beta_1X$
- Error: $\epsilon_i\sim^{iid}\mathcal{N}(0,\sigma^2)$
- Unusual Observations: sometimes just a few observations do not fit the model. These few observations might change the choice and fit of the model.
Linearity of Regression Function
- Nonlinearity of the regression function can be studied from a scatter plot, but is not always effective.
- Residual plots
- Residual plot against the predictor variable
- Residual plot against the fitted values
Linearity Check
Toluca Company Example:
library("ALSM")
mydata = TolucaCompany
X = mydata$x
Y = mydata$y
mymodel = lm(Y ~ X)
residuals(mymodel)
plot(X, mymodel$residuals, col = "orange", pch = 16, ylim=c(-120,150))
abline(h = 0)