Learn R Programming

diffIRT (version 1.5)

anova: Conduct a likelihood ratio test on two nested diffIRT models

Description

Using this function, a likelihood ratio test is conducted on two nested diffIRT model. Results are printed to the screen togheter with the AIC, BIC, sample size adjusted BIC, and DIC comparative fit indices for both models.

Usage

"anova"(object, object2, ...)

Arguments

object
a diffIRT object that is nested within the model provided in object2.
object2
a diffIRT object.
...
additional parameters, currently not used.

See Also

diffIRT for fitting diffusion IRT models.

Examples

Run this code
## Not run: 
# 
# # simulate data according to a D-diffusion model 
# # with equal a[i] parameters 
# data=simdiff(100,10,
#   ai=rep(.3,10),vi=seq(-1,1,length=10),ter=runif(10,2,3),
#   gamma=rlnorm(100,0,.3),theta=rnorm(100,0,.5),
#   model="D")
# 
# # fit a full D-diffusion model
# res=diffIRT(data$rt,data$x,model="D")
# 
# # fit a D-diffusion model subject to an 
# # equality constraint across all a[i] parameters
# res2=diffIRT(data$rt,data$x,model="D",constrain=c(rep(1,10),2:21,22,23))
# 
# # use the anova function to conduct the likelihood ratio test
# anova(res2,res)
# 
# ## End(Not run)

Run the code above in your browser using DataLab