B.FIXED可选矩阵,带有四个用于固定矩阵的列 2PL估计中的条目。第一列:项目索引,第二列: 类别,第三列:维度,第四列:固定值。
使用以下代码使用正确的语法?需要为任何项目的每个类别进行修复加载,而
# Example data n_cand <- 10 n_items <- 3 data <- matrix(sample(0:1, n_cand * n_items, replace = TRUE), nrow = n_cand, ncol = n_items) # Define fixed item difficulties and discriminations xsi.fixed <- cbind(1:n_items, diff = c(-1, 0, 1.2)) # arbitrary values b.fixed <- cbind(1:n_items, category = 0, dimension = 1, discr = c(1, 1.2, 0.9)) # Example values # Fit the 2PL model mod <- tam.mml.2pl(resp = data, xsi.fixed = xsi.fixed, B.fixed = b.fixed)
category
列是以1。1的计数器。类别列不能为
0
.。
n_cand <- 10
n_items <- 3
data <- matrix(sample(0:1, n_cand * n_items, replace = TRUE), nrow = n_cand, ncol = n_items)
# Define fixed item difficulties and discriminations
xsi.fixed <- cbind(1:n_items, diff = c(-1, 0, 1.2)) # arbitrary values
b.fixed <- rbind(
cbind(1:n_items, category = 1, dimension = 1, discr = c(0, 0, 0)),
cbind(1:n_items, category = 2, dimension = 1, discr = c(1, 1.2, 0.9))) # Example values
# Fit the 2PL model
mod <- tam.mml.2pl(resp = data, xsi.fixed = xsi.fixed, B.fixed = b.fixed)
mod$B