Learn R Programming

wle (version 0.9-91)

residualsAnscombe: Anscombe residuals

Description

Evaluate the Anscombe residuals for a given type of family in GLM.

Usage

residualsAnscombe(y, mu, family, ...)

Arguments

y
vector of the response variable
mu
vector of the same length as y with the corresponding fitted.values.
family
an object of class family.
...
not used yet.

Value

  • It return a vector with the Anscombe residuals.

Details

The function performs the Anscombe transformation to obtain residuals that are asymptotically normal distributed. For the Binomial family (see Con and Snell 1968) the transformation is $$beta(2/3,2/3)*(pbeta(y/m, 2/3, 2/3) - pbeta(mu-(1-2*mu)/(6*m), 2/3, 2/3))/((mu^(1/6)*(1-mu)^(1/6))/sqrt(m))$$ where m is the number of trial and y the number of successes. For the Poisson family (see Con and Snell 1968) the transformation is $$(3/2*(y^(2/3) - (mu-1/6)^(2/3)))/(mu^(1/6))$$ while for the Gamma family (see McCullagh and Nelder 1989) the transformation is $$3*(y^(1/3) - mu^(1/3))/(mu^(1/3))$$ and for the Inverse Gaussian family (see McCullagh and Nelder 1989) the transformation is $$(\ln(y)-\ln(mu))/\sqrt(mu)$$

References

Agostinelli, C. and Al-quallaf, F. (2009) Robust inference in Generalized Linear Models. Manuscript in preparation.

D. R. Cox and E. J. Snell. A general definition of residuals. Journal of the Royal Statistical Society. Series B (Methodological), 30(2):248-275, 1968.

R. M. Loynes. On cox and snell's general definition of residuals. Journal of the Royal Statistical Society. Series B (Methodological), 31(1):103-106, 1969.

D. A. Pierce and D. W. Schafer. Residuals in generalized linear models. Journal of the American Statistical Association, 81(396):977-986, 1986.

Rollin Brant. Residual components in generalized linear models. The Canadian Journal of Statistics, 15(2):115-126, 1987.

See Also

wle.glm

Examples

Run this code
## Dobson (1990) Page 93: Randomized Controlled Trial :
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
treatment <- gl(3,3)
print(d.AD <- data.frame(treatment, outcome, counts))
wle.glm.D93 <- wle.glm(counts ~ outcome + treatment, family=poisson())
res <- residualsAnscombe(counts, mu=wle.glm.D93$root1$fitted.values, family=poisson())
qqnorm(res)
qqline(res)

Run the code above in your browser using DataLab