mirt()函数的帮助文件后面有30多个例子,里面确实没有把题目参数又代入mirt()函数进行估计的例子;
但是ltm()函数有一个叫做“constraint”的参数,可以指定某一道题目(或某些题目)的参数固定为指定的数值,帮助文件的原文是:
constraint:a three-column numeric matrix with at most pq - 1 rows (where p is the number of items and q the number of latent components plus the intercept), specifying fixed-value constraints. The first column represents the item (i.e., 1 denotes the first item, 2 the second, etc.), the second column represents the component of the latent structure (i.e., 1 denotes the intercept beta{0i}, 2 the loadings of the first factor beta{1i}, etc.) and the third column denotes the value at which the corresponding parameter should be fixed. See Details and Examples for more info.
那么,能不能把所有题目的难度和区分度都固定住呢?
我试了一下,好像不能,上面的原文也说了最多只能固定pq-1个参数,为什么要-1呢?
应该就是说至少得留出一个可以自由估计的参数,否则模型就没法估计了。所以这种固定参数的方法和“条件估计”应该是两种截然不同的应用。
我试的时候用的是ltm包自带的WIRS数据:6道题目(0/1计分),1005个被试。先随机挑出505个被试进行2PL模型的估计,得到了6道题目的难度和区分度(共12个参数),然后用剩下的500个被试也进行2PL模型的估计,此时限定题目参数必须与之前的12个参数相等,于是便报错了:
Error in ltm(dat500 ~ z1, constraint = coef3) : 'constraint' should be a 3-column numeric matrix with at most 11 rows (read help file).
之后我尝试只限定前5题的难度和区分度与505人时一致,就能正常运行。