Database Reference
In-Depth Information
• Add extra input variables or terms to the regression model.
Figure 6.5 Income as a quadratic function of Age
Common transformations include taking square roots or the logarithm of the
variables. Another option is to create a new input variable such as the age squared
and add it to the linear regression model to fit a quadratic relationship between an
input variable and the outcome.
Additional use of transformations will be considered when evaluating the
residuals.
Evaluating the Residuals
As stated previously, it is assumed that the error terms in the linear regression
model are normally distributed with a mean of zero and a constant variance. If
this assumption does not hold, the various inferences that were made with the
hypothesis tests, confidence intervals, and prediction intervals are suspect.
To check for constant variance across all y values along the regression line, use
a simple plot of the residuals against the fitted outcome values. Recall that the
residuals are the difference between the observed outcome variables and the fitted
value based on the OLS parameter estimates. Because of the importance of
examining the residuals, the lm() function in R automatically calculates and
stores the fitted values and the residuals, in the components fitted.values
and residuals in the output of the lm() function. Using the Income regression
model output stored in results2 , Figure 6.6 was generated with the following R
code:
Search WWH ::




Custom Search