O'Reilly logo

R Statistical Application Development by Example Beginner's Guide by Prabhanjan Narayanachar Tattar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – residual plots for model validation

The R functions resid and fitted can be used to extract residuals and fitted values from an lm object.

  1. Find the residuals of the fitted regression model using the resid function: IO_lm_resid <- resid(IO_lm).
  2. We need six plots, and hence we invoke the graphics editor with par(mfrow = c(3,2)).
  3. Sketch the plot of residuals against the predictor variable with plot(No_of_IO, IO_lm_resid).
  4. To check whether the regression model is linear or not, obtain the plots of absolute residual values against the predictor variable and also that of squared residual values against the predictor variable respectively with plot(No_of_IO, abs(IO_lm_resid),…) and plot(No_of_IO, IO_lm_resid^2,…).
  5. The assumption that errors ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required