anova {ltm} | R Documentation |
Performs a Likelihood Ratio Test between two nested IRT models or performs a parametric Bootstrap test for Rasch models.
## S3 method for class 'grm': anova(object, object2, ...) ## S3 method for class 'ltm': anova(object, object2, ...) ## S3 method for class 'rasch': anova(object, object2 = NULL, B = 49, ...)
object |
an object inheriting from either class grm , class ltm or class rasch ,
representing the model under the null hypothesis. |
object2 |
an object inheriting from either class grm , class ltm or class rasch ,
representing the model under the alternative hypothesis. |
B |
the number of Bootstrap samples. See Details section for more info. |
... |
additional arguments; currently none is used. |
If object
is only supplied and object
inherits from class rasch
, then anova.rasch()
performs a parametric Bootstrap test based on Pearson's chi-squared statistic. The Bootstrap
approximation to the reference distribution is preferable compared with
the ordinary Chi-squared approximation since the latter is not valid especially
for large number of items (=> many response patterns with expected frequencies
smaller than 1).
In particular, the Bootstrap test is implemented as follows:
object
compute the observed value of the statistic T_{obs}.B
times and estimate the p-value using
[1 + {# T_i > T_{obs}}]/(B + 1).
If both object
and object2
are supplied, then a likelihood ratio test between the two fitted
models is performed.
An object of either class aov.grm
, class aov.ltm
or class aov.rasch
with components,
Tobs |
the value of the Pearson's chi-squared statistic for the observed data. Returned if object is only supplied. |
B |
the B argument specifying the number of Bootstrap samples used. Returned if object is only supplied. |
call |
the matched call of object . Returned if only object is supplied. |
nam0 |
the name of object . Returned if object2 is also supplied. |
L0 |
the log-likelihood under the null hypothesis (object ). Returned if object2 is also supplied. |
aic0 |
the AIC value for the model given by object . Returned if object2 is also supplied. |
bic0 |
the BIC value for the model given by object . Returned if object2 is also supplied. |
nam1 |
the name of object2 . Returned if object2 is also supplied. |
L1 |
the log-likelihood under the alternative hypothesis (object2 ). Returned if object2 is also supplied. |
aic1 |
the AIC value for the model given by object2 . Returned if object2 is also supplied. |
bic1 |
the BIC value for the model given by object2 . Returned if object2 is also supplied. |
LRT |
the value of the Likelihood Ratio Test statistic. Returned if object2 is also supplied. |
df |
the degrees of freedom for the test (i.e., the difference in the number of parameters). Returned if object2 is also supplied. |
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 constrained and unconstrained GRMs ## for the Science data: m0 <- grm(Science[c(1,3,4,7)], constrained = TRUE) m1 <- grm(Science[c(1,3,4,7)]) anova(m0, m1) ## LRT between the one- and two-factor models ## for the Wirs data: anova(ltm(Wirs ~ z1), ltm(Wirs ~ z1 + z2)) ## GoF for the Rasch model for the Lsat data: m <- rasch(Lsat) anova(m) ## An LRT between the Rasch and a constrained ## two-parameter logistic model for the Wirs data: m0 <- rasch(Wirs) m1 <- ltm(Wirs ~ z1, constraint = cbind(c(1, 3, 5), 2, 1)) anova(m0, m1) ## An LRT between the constrained (discrimination ## parameter equals 1) and the unconstrained Rasch ## model for the Lsat data: m0 <- rasch(Lsat, constraint = rbind(c(6, 1))) m1 <- rasch(Lsat) anova(m0, m1) ## An LRT between the Rasch and the two-parameter ## logistic model for the Lsat data: anova(rasch(Lsat), ltm(Lsat ~ z1))