anova.jmdem: Analysis of Deviance for Joint Mean and Dispersion Effect...

Description Usage Arguments Details Value Warning Author(s) References See Also Examples

Description

Compute an analysis of deviance table for one or more double generalised linear model fits.

Usage

1
2
3
## S3 method for class 'jmdem'
anova(object, ..., test = NULL, type = c("1", "3"), 
      print.results = TRUE)

Arguments

object, ...

one or several objects of class jmdem, typically the result of a call to jmdem.

test

a character string, (partially) matching one of "Rao" or "Wald". See stat.anova.jmdem.

type

a character string or integer, specifying whether a type "1" (sequential) analysis or a type "3" (partial) analysis should be conducted. It is only relevant if a single object is specified in object. Both numeric and character inputs are allowed. See details for type 1 and type 3 analysis.

print.results

logical, TRUE if the result table should be printed directly, FALSE if the results should be saved in an user-defined object.

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 anova table constructed for the mean submodel.

table.z

the anova table constructed for the dispersion submodel.

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

jmdem, anova

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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)

Example output

Type 3 Analysis of Deviance Table

Response: y
Mean Effect Model: poisson(link = log)
Terms removed partially

     Resid. Df Resid. Dev Resid. Dev / Df Df   Wald  Pr(>Chi)    
FULL        96        100          1.0417                        
x           97        100          1.0309  1 80.934 < 2.2e-16 ***
---
Signif. codes:  0***0.001**0.01*0.05.’ 0.1 ‘ ’ 1

Dispersion Effect Model: Gamma(link = log)
Terms removed partially

     Resid. Df Resid. Dev Resid. Dev / Df Df   Wald Pr(>Chi)   
FULL        98     119.60          1.2204                      
z           99     128.22          1.2951  1 7.5835 0.005891 **
---
Signif. codes:  0***0.001**0.01*0.05.’ 0.1 ‘ ’ 1

jmdem documentation built on March 13, 2020, 2:20 a.m.

Related to anova.jmdem in jmdem...