Description Usage Arguments Details See Also Examples
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’.
1 2 |
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 returned.
hmmm.mlfit
, summary.hmmmfit
, print.hmmmfit
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.