Return the raw, standardized or Pearson's residuals (the default) of a chi-squared test on a two-way frequency table.

1 | ```
chisq.residuals(tab, digits = 2, std = FALSE, raw = FALSE)
``` |

`tab` |
frequency table |

`digits` |
number of digits to display |

`std` |
if |

`raw` |
if |

This function is just a wrapper around the `chisq.test`

base R function. See this function's help page
for details on the computation.

1 2 3 4 5 6 7 8 9 | ```
## Sample table
data(Titanic)
tab <- apply(Titanic, c(1,4), sum)
## Pearson residuals
chisq.residuals(tab)
## Standardized residuals
chisq.residuals(tab, std = TRUE)
## Raw residuals
chisq.residuals(tab, raw = TRUE)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.