Plot of i-th residual vs i+1-th residual.

plotAutocorrelation(object, ..., variable = NULL, score = FALSE, smooth = FALSE)

object | An object of class modelAudit or modelResiduals. |
---|---|

... | Other modelAudit or modelResiduals objects to be plotted together. |

variable | Only for modelAudit object. Name of model variable to order residuals. If value is NULL data order is taken. If value is "Predicted response" or "Fitted values" then data is ordered by fitted values. If value is "Observed response" the data is ordered by a vector of actual response ( |

score | Logical, if TRUE values of scoreDW and scoreRuns will be added to plot. |

smooth | Logical, if TRUE smooth line will be added. |

library(car) lm_model <- lm(prestige~education + women + income, data = Prestige) lm_au <- audit(lm_model, data = Prestige, y = Prestige$prestige) plotAutocorrelation(lm_au)plotAutocorrelation(lm_au, variable = "income", score = TRUE, smooth = TRUE)