qres

0th

Percentile

Randomized Quantile Residuals

Computes randomized quantile residuals for binomial, Poisson, negative binomial, gamma and inverse Gaussian generalized linear models.

Keywords
regression
Usage
qres.binom(glm.obj)
qres.pois(glm.obj)
qres.nbinom(glm.obj)
qres.gamma(glm.obj,dispersion=NULL)
qres.invgauss(glm.obj,dispersion=NULL)
qres.tweedie(glm.obj,dispersion=NULL)
Arguments
glm.obj
Object of class glm. The generalized linear model family is assumed to be binomial for qres.binom, poisson for qres.pois, negative binomial for qres.nbinom, Gamma for qres.gamma, inverse G
dispersion
a positive real number. Specifies the value of the dispersion parameter for a Gamma or inverse Gaussian generalized linear model if known. If NULL, the dispersion will be estimated by its Pearson estimator.
Details

Quantile residuals are based on the idea of inverting the estimated distribution function for each observation to obtain exactly standard normal residuals. In the case of discrete distributions, such as the binomial and Poisson, some randomization is introduced to produce continuous normal residuals. Quantile residuals are the residuals of choice for generalized linear models in large dispersion situations when the deviance and Pearson residuals can be grossly non-normal. Quantile residuals are the only useful residuals for binomial or Poisson data when the response takes on only a small number of distinct values.

Value

  • Numeric vector of standard normal quantile residuals.

References

Dunn, K. P., and Smyth, G. K. (1996). Randomized quantile residuals. Journal of Computational and Graphical Statistics 5, 1-10. http://www.statsci.org/smyth/pubs/residual.html

See Also

http://www.statsci.org/s/qres.html, residuals.glm

Aliases
  • qres
  • qres.binom
  • qres.pois
  • qres.nbinom
  • qres.gamma
  • qres.invgauss
  • qres.tweedie
Examples
y <- rpois(20,lambda=4)
x <- 1:20
fit <- glm(y~x,family="poisson")
qr <- qres.pois(fit)
qqnorm(qr)
qqline(qr)
Documentation reproduced from package statmod, version 1.0.8, License: LGPL version 2 or newer

Community examples

Looks like there are no examples yet.