anova.ltm {ltm}R Documentation

Anova method for ltm objects

Description

Performs a Likelihood Ratio Test between two nested ltm objects.

Usage

anova.ltm(object, obj2, ...)

Arguments

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.

Value

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.

Warning

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.

See Also

ltm

Examples


## 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)


[Package ltm version 0.1-1 Index]