Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

anova.glmgee

Comparison of nested Generalized Estimating Equations


Description

Allows to compare nested generalized estimating equations using the Wald and generalized score tests.

Usage

## S3 method for class 'glmgee'
anova(object, ..., test = c("wald", "score"), verbose = TRUE)

Arguments

object

an (object) of the class glmgee which is obtained from the fit of a generalized estimating equation.

...

another objects of the class glmgee which are obtained from the fit of generalized estimating equations.

test

an (optional) character string indicating the required test. The available options are: Wald ("wald") and generalized score ("score") tests. By default, test is set to be "wald".

verbose

an (optional) logical switch indicating if should the report of results be printed. By default, verbose is set to be TRUE.

Value

A matrix with three columns which contains the following:

  • Chi: The value of the statistic of the test.

  • Df: The number of degrees of freedom.

  • Pr(>Chi): The p-value of the test computed using the Chi-square distribution.

References

Boos D. (1992) On Generalized Score Tests. American Statistician 46, 327–33.

Rotnitzky A. and Jewell N.P. (1990). Hypothesis Testing of Regression Parameters in Semiparametric Generalized Linear Models for Cluster Correlated Data. Biometrika 77, 485-497.

Examples

## Example 1
mod <- size ~ poly(days,4)
fit1 <- glmgee(mod, id=tree, family=Gamma("log"), data=spruce, corstr="AR-1")
fit2 <- update(fit1, . ~ . + treat)
fit3 <- update(fit2, . ~ . + poly(days,4):treat)
anova(fit1,fit2,fit3,test="wald")
anova(fit3,test="wald")
anova(fit1,fit2,fit3,test="score")
anova(fit3,test="score")

## Example 2
mod2 <- depressd ~ group
fit1 <- glmgee(mod2, id=subj, family=binomial("logit"), corstr="Exchangeable", data=depression)
fit2 <- update(fit1, . ~ . + visit)
fit3 <- update(fit2, . ~ . + group:visit)
anova(fit1,fit2,fit3,test="wald")
anova(fit3,test="wald")
anova(fit1,fit2,fit3,test="score")
anova(fit3,test="score")

## Example 3
mod3 <- dep ~ group
fit1 <- glmgee(mod3, id=subj, family=gaussian("identity"), corstr="AR-1", data=depression)
fit2 <- update(fit1, . ~ . + visit)
fit3 <- update(fit2, . ~ . + group:visit)
anova(fit1,fit2,fit3,test="wald")
anova(fit3,test="wald")
anova(fit1,fit2,fit3,test="score")
anova(fit3,test="score")

glmtoolbox

Set of Tools to Data Analysis using Generalized Linear Models

v0.1.0
GPL-2 | GPL-3
Authors
Luis Hernando Vanegas [aut, cre], Luz Marina Rondón [aut], Gilberto A. Paula [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.