> require(mirt) Loading required package: mirt Loading required package: stats4 Loading required package: lattice > > name <- 'old2PL' > 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) > > dat <- expand.table(LSAT7) > mod <- mirt(dat, 1, c(rep('2PL',4), 'old2PL'), customItems=list(old2PL=x)) Iteration: 24, Log-Lik: -2658.805, Max-Change: 0.00005 > fscores(mod, response.pattern=c(0,0,1,1,0)) Item.1 Item.2 Item.3 Item.4 Item.5 Freq F1 SE_F1 [1,] 0 0 1 1 0 1 -0.7549973 0.6728278 > fscores(mod, response.pattern=matrix(c(0,0,1,1,0, 1,1,0,0,1), 2, byrow=TRUE)) Item.1 Item.2 Item.3 Item.4 Item.5 Freq F1 SE_F1 [1,] 0 0 1 1 0 1 -0.7549973 0.6728278 [2,] 1 1 0 0 1 1 -0.5995563 0.6803557 > > sessionInfo() R version 3.1.0 (2014-04-10) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_CA.UTF-8 LC_NUMERIC=C LC_TIME=en_CA.UTF-8 [4] LC_COLLATE=en_CA.UTF-8 LC_MONETARY=en_CA.UTF-8 LC_MESSAGES=en_CA.UTF-8 [7] LC_PAPER=en_CA.UTF-8 LC_NAME=C LC_ADDRESS=C [10] LC_TELEPHONE=C LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats4 stats graphics grDevices utils datasets methods base other attached packages: [1] mirt_1.3.6 lattice_0.20-29 testthat_0.8.1 devtools_1.5 loaded via a namespace (and not attached): [1] digest_0.6.4 evaluate_0.5.5 GPArotation_2012.3-1 grid_3.1.0 [5] httr_0.3 memoise_0.2.1 numDeriv_2012.9-1 parallel_3.1.0 [9] Rcpp_0.11.1 RCurl_1.95-4.1 stringr_0.6.2 tools_3.1.0 [13] whisker_0.3-2
Hi Phil, you are right, this happens when i pass a response.pattern to fscores(). Thanks, felix
--
--
> coef(mod, digits = 10) $Comfort a b1 b2 b3 par 0.8652818 -3.268075 -2.881734 1.532433 $Work a b1 b2 b3 par 0.8403551 -2.035006 -1.032612 2.058211 $Future a b1 b2 b3 par 2.215178 -2.087085 -0.9778947 0.8335761 $Benefit a b1 b2 b3 par 0.7233524 -2.899758 -1.105971 1.627087 $GroupPars MEAN_1 COV_11 par 5.48909e-05 0.9997952
No, it should set the item parameters to FALSE, but the GROUP parameters to TRUE.
--