Learn R Programming

bild (version 1.2-1)

anova-methods: Methods for Function anova in Package "bild"

Description

Compute an analysis deviance table for two fitted model objects.

Usage

# S4 method for bild
anova(object, ..., test = TRUE, correct = FALSE)

Arguments

object

an object of class bild.

...

an object of class bild.

test

an optional logical value controlling whether likelihood ratio tests should be used to compare the fitted models represented by object and by y. The default is TRUE.

correct

an optional logical value controlling whether the p-value of the likelihood ratio test must be corrected. The default is FALSE.

Warning

The comparison between two models by anova will only be valid if they are fitted to the same dataset.

Methods

signature(object = "ANY"):

Generic function.

signature(object="bild"):

Anova for bild object.

Details

correct = TRUE is used to test the presence of a random intercept term and the solution proposed by Self and Liang (1987) is adopted only to the p-value.

References

Self, Steven G. and Liang, Kung-Yee (1987). Asymptotic properties of maximum likelihood estimators and likelihood ratio tests under nonstandard conditions. Journal of the American Statistical Association, 82, 605-610.

Examples

Run this code
#####  data = locust

loc1 <- bild(move~(time+I(time^2))*feed*sex, data=locust, dependence="MC1")

loc2 <- bild(move~(time+I(time^2))*feed, data=locust, dependence="MC1")

anova(loc1,loc2)

loc3 <- bild(move~(time+I(time^2))*feed, data=locust, dependence="MC2")

anova(loc3,loc2)

#####  data= muscatine
# \donttest{ 
# we decompose the time effect in orthogonal components
muscatine$time1 <- c(-1, 0, 1)
muscatine$time2 <- c(1, -2, 1)

musc1 <- bild(obese~time1, data=muscatine, time="time1", 
        dependence="MC1")

musc1r <- bild(obese~time1, data=muscatine, time="time1", 
        dependence="MC1R")

anova(musc1, musc1r, correct=TRUE)
# }

Run the code above in your browser using DataLab