Hi Phil,
Before experimenting with adding a custom item model directly, I'm trying createItem. Wondering if more than one custom item type is not supported or if I just have a silly coding error. Below is an example that under version 1.13 gives me the following error: "Error in customItems[[itemtype[i] == names(customItems)]] :
attempt to select less than one element"
Thanks!
Carl
name <- 'old2PL'
name2<- 'old2PL2'
par <- c(a = .5, b = -2)
est <- c(TRUE, TRUE)
P.old2PL <- function(par,Theta, ncat){
a <- par[1]
b <- par[2]
P1 <- 1 / (1 + exp(-1*a*(Theta - b)))
cbind(1-P1, P1)
}
x <- createItem(name, par=par, est=est, P=P.old2PL)
P.old2PL2 <- function(par,Theta, ncat){
a <- par[1]
b <- par[2]
P1 <- 1 / (1 + exp(-1.702*a*(Theta - b)))
cbind(1-P1, P1)
}
x2 <- createItem(name2, par=par, est=est, P=P.old2PL2)
dat <- expand.table(LSAT7)
sv <- mirt(dat, 1, c(rep('2PL',3), 'old2PL', 'old2PL2'), customItems=list(old2PL=x, old2PL2=x2), pars = 'values')