anova.ltm {ltm} | R Documentation |
Performs a Likelihood Ratio Test between two nested ltm
objects.
## S3 method for class 'ltm': anova(object, object2, ...)
object |
an object inheriting from class ltm representing the model
under the null hypothesis. |
object2 |
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 object2 . |
L1 |
the log-likelihood under the alternative hypothesis (object2 ). |
aic1 |
the AIC value for the model given by object2 . |
bic1 |
the BIC value for the model given by object2 . |
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 models ## for the Wirs data: anova(ltm(Wirs ~ z1), ltm(Wirs ~ z1 + z2)) ## LRT between the two-factor and the interaction ## models for the Mobility data: anova(ltm(Mobility ~ z1 + z2), ltm(Mobility ~ z1 * z2))