View source: R/3-inference-functions.R
lr_test | R Documentation |
Function to perform likelihood ratio test between two or multiple staged event tree models.
lr_test(object, ...)
object |
an object of class |
... |
further objects of class |
If a single object of class sevt
is passed as
argument, it computes
the likelihood-ratio test with respect to the
independence model.
If multiple objects are passed,
likelihood-ratio tests between the first
object and the followings are computed.
In the latter casem the function checks automatically if
the first model is nested in the additional ones,
via inclusions_stages
, and throws
an error if not.
An object of class anova
which contains the log-likelihood,
degrees of freedom,
difference in degrees of freedom, likelihood ratio
statistics and corresponding p values.
data(PhDArticles) order <- c("Gender", "Kids", "Married", "Articles") phd.mod1 <- stages_hc(indep(PhDArticles, order)) phd.mod2 <- stages_hc(full(PhDArticles, order)) ## compare two nested models lr_test(phd.mod1, phd.mod2) ## compare a single model vs the independence model lr_test(phd.mod1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.