Skip to contents

Pearson and standardized Pearson residuals for binomial and Poisson GLMs

Usage

GlmStdRes(y, X, family = c("binomial", "poisson"), trials = NULL)

Arguments

y

Successes or counts.

X

Design matrix.

family

"binomial" or "poisson".

trials

Binomial trials.

Value

list(fitted, pearson, standardized, hat, beta, deviance, pearson_chisq, df).

References

Bilder, C. R. & Loughin, T. M. (2025). Analysis of Categorical Data with R, 2nd ed. Sec 5.2.1.

Examples

GlmStdRes(c(2, 3, 6, 7, 8, 9, 10, 12, 15), cbind(1, 0:8), family = "poisson")$standardized
#> [1] -0.8027517 -0.5388782  0.6139325  0.5312052  0.3732472  0.1482940 -0.1487796
#> [8] -0.2258730 -0.1495524