| anova.ltm {ltm} | R Documentation |
Performs a Likelihood Ratio Test between two nested ltm objects.
## S3 method for class 'ltm': anova(object, obj2, ...)
object |
an object inheriting from class ltm representing the model
under the null hypothesis. |
obj2 |
an object inheriting from class ltm representing the model
under the alternative hypothesis. |
... |
additional arguments; currently none is used. |
An object of class aov.ltm with components,
nam0 |
the name of object. |
L0 |
the log-likelihood under the null hypothesis (object). |
aic0 |
the AIC value for the model given by object. |
bic0 |
the BIC value for the model given by object. |
nam1 |
the name of obj2. |
L1 |
the log-likelihood under the alternative hypothesis (obj2). |
aic1 |
the AIC value for the model given by obj2. |
bic1 |
the BIC value for the model given by obj2. |
LRT |
the value of the Likelihood Ratio Test statistic. |
df |
the degrees of freedom for the test (i.e., the difference in the number of parameters). |
p.value |
the p-value of the test. |
The code does not check if the models are nested! The user is responsible to supply nested models in order the LRT to be valid.
Dimitris Rizopoulos dimitris.rizopoulos@med.kuleuven.be
## LRT between the one- and two-factor model ## for the Wirs data: m1 <- ltm(Wirs~z1) m2 <- ltm(Wirs~z1+z2) anova(m1, m2) ## LRT between the two-factor and the interaction ## model for the Mobility data: m1 <- ltm(Mobility~z1+z2) m2 <- ltm(Mobility~z1*z2) anova(m1, m2)