| anova.hmmmfit | R Documentation | 
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’.
## S3 method for class 'hmmmfit'
anova(object,objectlarge,...)| object | Object of the class  | 
| objectlarge | Object of the class  | 
| ... | Other models and further arguments passed to or from other methods | 
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 printed.
A matrix with information about Likelihood ratio tests degree of freedom and P values for the compared models.
hmmm.mlfit, summary.hmmmfit, print.hmmmfit
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.