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