Test for Varying Dispersion Parameter in Generalized Linear Models
Performs Rao's score test for varying dispersion parameter in weighted and unweighted generalized linear models in which the response distribution is assumed to be gaussian, Gamma or inverse gaussian.
## S3 method for class 'glm' vdtest(model, varformula, verbose = TRUE, ...)
model |
an object of the class glm which is obtained from the fit of a weighted or unweighted generalized linear model in which the response distribution is assumed to be gaussian, Gamma or inverse gaussian. |
varformula |
an (optional) |
verbose |
an (optional) logical switch indicating if should the report of results be printed. By default, |
... |
further arguments passed to or from other methods. |
The aim of this test is to assess the assumption of constant dispersion parameter in generalized linear models. If the object model
corresponds to an unweighted generalized linear model then this test assess assumptions of constant variance and constant coefficient of variation on models in which the response distribution is assumed to be gaussian and Gamma, respectively.
A list which includes the three main attributes of the test for varying dispersion parameter: statistic ("statistic"), degrees of freedom ("df") and p-value ("p.value").
Wei BC., Shi JQ., Fung WK. and Hu YQ. (1998) Testing for Varying Dispersion in Exponential Family Nonlinear Models. Annals of the Institute of Statistical Mathematics 50, 277–294.
## Example 1 Auto <- ISLR::Auto fit1 <- glm(mpg ~ weight*horsepower, family=inverse.gaussian("log"), data=Auto) vdtest(fit1) ## Example 2 fit2 <- glm(rtime ~ log(distance) + log(cclimb), family=Gamma("log"), data=races) vdtest(fit2)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.