Description Usage Arguments Details See Also Examples
The generic function ‘anova’ is adapted to the objects inheriting from class hidden
(anova.hidden) to compute the likelihood ratio test for nested hidden models estimated by ‘hidden.emfit’.
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 ‘hidden.emfit’, are compared (e.g. modelA is nested in modelB), the likelihood ratio statistic with the degrees of freedom and the associated pvalue is returned.
hidden.emfit
, summary.hidden
, print.hidden
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | data(drinks)
y<-cbind(drinks$lemon.tea,drinks$orange.juice)
f<-~lat*tea+lat*juice+tea*juice # lat indicates the latent variable
fm<-c("l-l-l")
fmargobs<-marg.list(fm,mflag="m")
Ptr<-matrix(c(0.941, 0.199,
0.059, 0.801),2,2,byrow=TRUE)
Ptobs<-matrix(c(0.053, 0.215, 0.206, 0.001, 0.039, 0.021, 0.020, 0.176, 0.270,
0.000, 0.000, 0.000, 0.048, 0.263, 0.360, 0.065, 0.053, 0.211)
,2,9,byrow=TRUE)
# saturated model (fsat<-~lat*tea*juice is implicit)
model.obsf<-hmmm.model(marg=fmargobs,
lev=c(2,3,3),names=c("lat","tea","juice"))
modelsat<-(y,model.obsf,y.eps=0.01,maxit=10,
maxiter=2500,norm.diff.conv=0.001,old.tran.p=Ptr,bb=Ptobs)
# model with constant association
model.coass<-hmmm.model(marg=fmargobs,
lev=c(2,3,3),names=c("lat","tea","juice"),formula=f)
modelca<-(y,model.coass,y.eps=0.01,maxit=10,
maxiter=2500,norm.diff.conv=0.001,old.tran.p=Ptr,bb=Ptobs)
a<-anova(modelca,modelsat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.