Description Usage Arguments Value Examples

Computes residuals for a fitted linear or generalized linear model.

1 |

`object` |
a object of the class lm or glm obtained from the fit of a linear or a generalized linear model. |

`type` |
an (optional) character string giving the type of residuals which should be returned. The available options for LMs are: (1) externally studentized ("external"); (2) internally studentized ("internal") (default). The available options for GLMs are: (1) "pearson"; (2) "deviance"; (3) "quantile" (default). |

`standardized` |
an (optional) logical switch indicating if the residuals should be standardized by dividing by the square root of |

`plot.it` |
an (optional) logical switch indicating if a plot of the residuals is required. By default, |

`identify` |
an (optional) integer value indicating the number of individuals to identify on the plot of residuals. This is only appropriate when |

`...` |
further arguments passed to or from other methods |

A vector with the observed residuals type `type`

.

1 2 3 4 5 6 7 8 9 | ```
# Example 1
fit1 <- lm(Species ~ Biomass + pH + Biomass*pH, data=richness)
residuals2(fit1, type="external", col="red", pch=20, col.lab="blue",
col.axis="blue", col.main="black", family="mono", cex=0.8)
# Example 2
fit2 <- glm(infections ~ frequency + location, family=poisson, data=swimmers)
residuals2(fit2, type="quantile", col="red", pch=20,col.lab="blue",
col.axis="blue",col.main="black",family="mono",cex=0.8)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.