anova-logLik | R Documentation |
The anova
function compares two models estimated of class tam
,
tam.mml
or tam.mml.3pl
using a likelihood ratio test.
The logLik
function extracts the value of the log-Likelihood.
The function can be applied for values of tam.mml
,
tam.mml.2pl
, tam.mml.mfr
, tam.fa
,
tam.mml.3pl
, tam.latreg
or tamaan
.
## S3 method for class 'tam'
anova(object, ...)
## S3 method for class 'tam'
logLik(object, ...)
## S3 method for class 'tam.mml'
anova(object, ...)
## S3 method for class 'tam.mml'
logLik(object, ...)
## S3 method for class 'tam.mml.3pl'
anova(object, ...)
## S3 method for class 'tam.mml.3pl'
logLik(object, ...)
## S3 method for class 'tamaan'
anova(object, ...)
## S3 method for class 'tamaan'
logLik(object, ...)
## S3 method for class 'tam.latreg'
anova(object, ...)
## S3 method for class 'tam.latreg'
logLik(object, ...)
## S3 method for class 'tam.np'
anova(object, ...)
## S3 method for class 'tam.np'
logLik(object, ...)
object |
Object of class |
... |
Further arguments to be passed |
A data frame containing the likelihood ratio test statistic and information criteria.
#############################################################################
# EXAMPLE 1: Dichotomous data sim.rasch - 1PL vs. 2PL model
#############################################################################
data(data.sim.rasch)
# 1PL estimation
mod1 <- TAM::tam.mml(resp=data.sim.rasch)
logLik(mod1)
# 2PL estimation
mod2 <- TAM::tam.mml.2pl(resp=data.sim.rasch, irtmodel="2PL")
logLik(mod2)
# Model comparison
anova( mod1, mod2 )
## Model loglike Deviance Npars AIC BIC Chisq df p
## 1 mod1 -42077.88 84155.77 41 84278.77 84467.40 54.05078 39 0.05508
## 2 mod2 -42050.86 84101.72 80 84341.72 84709.79 NA NA NA
## Not run:
#############################################################################
# EXAMPLE 2: Dataset reading (sirt package): 1- vs. 2-dimensional model
#############################################################################
data(data.read, package="sirt")
# 1-dimensional model
mod1 <- TAM::tam.mml.2pl(resp=data.read )
# 2-dimensional model
mod2 <- TAM::tam.fa(resp=data.read, irtmodel="efa", nfactors=2,
control=list(maxiter=150) )
# Model comparison
anova( mod1, mod2 )
## Model loglike Deviance Npars AIC BIC Chisq df p
## 1 mod1 -1954.888 3909.777 24 3957.777 4048.809 76.66491 11 0
## 2 mod2 -1916.556 3833.112 35 3903.112 4035.867 NA NA NA
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.