anova.jmdem {jmdem} | R Documentation |
Analysis of Deviance for Joint Mean and Dispersion Effect Models Fits
Description
Compute an analysis of deviance table for one or more double generalised linear model fits.
Usage
## S3 method for class 'jmdem'
anova(object, ..., test = NULL, type = c("1", "3"),
print.results = TRUE)
Arguments
object , ... |
one or several objects of class |
test |
a character string, (partially) matching one of " |
type |
a character string or integer, specifying whether a type " |
print.results |
logical, |
Details
Specifying a single object gives a analysis of deviance table for that fit. If type 1
analysis is specified, a sequential analysis will be conducted. That is, the reductions in the residual deviance as each term of the formula is added in turn are given in as the rows of a table, plus the residual deviances themselves.
Type 3
analysis gives the reduction in the residual deviance of the fitted model after removing each term of the formula individually, that in turn are given as the rows of a table.
If more than one object is specified, the table has a row for the residual degrees of freedom and deviance for each model. For all but the first model, the change in degrees of freedom and deviance is also given. (This only makes statistical sense if the models are nested.) It is conventional to list the models from smallest to largest, but this is up to the user.
The table will optionally contain "Rao
" or "Wald
" test statistics (and P values) comparing the model specified in the current row and the row above (type 1
) or the full model (type 3
). Both "Rao
" and "Wald
" test statistics are asymptotically chi-square distributed. "LRT
" (Likelihood ratio test) and "F
" ((F test) are not included in anova.jmdem
because the comparison of the deviances of two joint mean and dispersion effects models is questionable, if not even invalid. One important argument is that the dependent variables of two different dispersion submodels given two different mean submodels are not the identical.
Value
An object of class "anova
" inheriting from class "data.frame
".
If print.results = TRUE
,
table.x |
the |
table.z |
the |
Warning
The comparison between two or more models will only be valid if they are fitted to the same dataset. This may be a problem if there are missing values and R
's default of na.action = na.omit
is used, and anova
will detect this with an error.
Author(s)
Karl Wu Ka Yui (karlwuky@suss.edu.sg)
References
Hastie, T. J. and Pregibon, D. (1992). Generalized linear models. Chapter 6 of Statistical Models in S eds J. M. Chambers and T. J. Hastie, Wadsworth & Brooks/Cole.
McCullagh P. and Nelder, J.A. (1989) Generalized Linear Models. London: Chapman and Hall.
Smyth, G.K. (1989). Generalized linear models with varying dispersion. J. R. Statist. Soc. B, 51 (1), 47-60.
Smyth, G.K., Verbyla, A.P. (1996). A conditional likelihood approach to residual maximum linear estimation in generalized linear models. J. R. Statist. Soc. B, 58 (3), 565-572.
Smyth, G.K., Verbyla, A.P. (1999). Adjusted likelihood methods for modelling dispersion in generalized linear models. Environmetrics, 10, 695-709.
Wu, K.Y.K., Li, W.K. (2016). On a dispersion model with Pearson residual responses. Comput. Statist. Data Anal., 103, 17-27.
See Also
Examples
## Example in jmdem(...)
MyData <- simdata.jmdem.sim(mformula = y ~ x, dformula = ~ z,
mfamily = poisson(),
dfamily = Gamma(link = "log"),
beta.true = c(0.5, 4),
lambda.true = c(2.5, 3), n = 100)
fit <- jmdem(mformula = y ~ x, dformula = ~ z, data = MyData,
mfamily = poisson, dfamily = Gamma(link = "log"),
dev.type = "deviance", method = "CG")
## Run a partial analysis (type 3) with Wald test
anova(fit, test = "Wald", type = 3)