diagn function

Computes diagnostics for generalized linear models.

Computes diagnostics for generalized linear models.

Given a glm object, diagn returns case-level diagnostics. For logistic, probit, Poisson, and negative binomial models, it returns Pearson residuals, standardized Pearson residuals, the diagonal of the hat matrix, delta-beta (Cook's D), and deviance residuals. For zero-inflated and hurdle models, it returns the Pearson residual and the observation number.

diagn(model)

Arguments

  • model: A model object. The model should be regression model for limited dependent variables, such as a logistic regression.

Returns

  • out: The output is a dataframe of diagnostic statistics. For logit, probit, Poisson, and negative binomial models, the output includes the Pearson residual (pearsonres), the diagonal of the Hat matrix (h), the standardized Pearson residual (stdpres), the delta-beta statistic (deltabeta), the observation number (obs), and the deviance residual (devres). For zero-inflated and hurdle models, the output includes the Pearson residual (pearsonres), and the observation number (obs).

Author(s)

David Melamed

Examples

data("Mize19AH") m1 <- glm(alcB ~woman*parrole + age + race2 + race3 + race4 + income + ed1 + ed2 + ed3 + ed4, family="binomial",data=Mize19AH) head(diagn(m1))
  • Maintainer: David Melamed
  • License: GPL-2 | GPL-3
  • Last published: 2024-09-04

Useful links