anova.hmmmfit: anova for the class hmmmfit

Description Usage Arguments Details See Also Examples

Description

The generic function ‘anova’ is adapted to the objects inheriting from class hmmmfit (anova.hmmmfit) to compute the likelihood ratio test for nested hmm models estimated by ‘hmmm.mlfit’.

Usage

1
2
## S3 method for class 'hmmmfit'
anova(object,objectlarge,...)

Arguments

object

Object of the class hmmmfit, reduced model, i.e. modelA

objectlarge

Object of the class hmmmfit, large model, i.e. modelB

...

Other models and further arguments passed to or from other methods

Details

Nested models, fitted by ‘hmmm.mlfit’, are compared (e.g. modelA is nested in modelB), the likelihood ratio statistic with the degrees of freedom and the associated pvalue is returned.

See Also

hmmm.mlfit, summary.hmmmfit, print.hmmmfit

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(madsen)
y<-getnames(madsen)
names<-c("Infl","Sat","Co","Ho")

fA<-~Co*Ho+Sat*Co+Sat*Ho
modelA<-loglin.model(lev=c(3,3,2,4),formula=fA,names=names)
fB<-~Co*Ho+Sat*Co+Infl*Co+Sat*Ho+Infl*Sat
modelB<-loglin.model(lev=c(3,3,2,4),formula=fB,names=names)

modA<-hmmm.mlfit(y,modelA)
modB<-hmmm.mlfit(y,modelB)

anova(modA,modB)

hmmm documentation built on May 2, 2019, 12:27 p.m.