anova.eglhmm | R Documentation |
eglhmm
models.
Apply a likelihood ratio test to determine whether the difference,
between the log likelihood statistics of two fitted eglhmm
models,
is statistically significant.
## S3 method for class 'eglhmm'
anova(object, ...)
object |
An object of class |
... |
Precisely one more object of class |
This anova method handles only comparisons between two
models.) The order of the arguments (i.e. which object is passed
as “object
” and which is passed as the sole entry
of the ... argument) is immaterial.
A list with components
stat
the likelihood ratio statistic, i.e. the difference
between the log likelihoods of the two models. That for the model
with the smaller number of parameters is subtracted from that for
the model with the larger number.
df
the degrees of freedom of the likelihood ratio statistic,
i.e. the difference between the number of parameters of the respective
models. The smaller number is subtracted from the larger.
pvalue
the p
-value of the test as given by
pchisq(stat, df, lower.tail = FALSE)
.
This list has an attribute "details"
consisting of a numeric
vector of length four with entries ll1
(the smaller of the
log likelihoods), ll2
(the larger of the log likelihoods),
np1
(the smaller of the parameter counts) and np2
(the larger of the parameter counts).
Rolf Turner rolfturner@posteo.net
fit1 <- eglhmm(formula=y~locn+depth,data=SydColCount,
cells=c("locn","depth"),distr="P",K=2,
method="em",verb=TRUE)
fit2 <- eglhmm(formula=y~locn+depth+ma.com+nh.com+bo.com,data=SydColCount,
cells=c("locn","depth"),distr="P",K=2,
method="em",verb=TRUE)
anova(fit1,fit2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.