最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to fix items' discrimination in a IRT model with two parameters with the `TAM` package in R? - Stack Overflow

programmeradmin3浏览0评论

According to the TAM documentation, one has to supply a matrice for the items parameters (difficulty and discrimination)

B.fixed An optional matrix with four columns for fixing matrix entries in 2PL estimation. 1st column: item index, 2nd column: category, 3rd column: dimension, 4th column: fixed value.

Does the following code use the right syntax?

# 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
library(TAM)
mod <- tam.mml.2pl(resp = data, xsi.fixed = xsi.fixed, B.fixed = b.fixed)

According to the TAM documentation, one has to supply a matrice for the items parameters (difficulty and discrimination)

B.fixed An optional matrix with four columns for fixing matrix entries in 2PL estimation. 1st column: item index, 2nd column: category, 3rd column: dimension, 4th column: fixed value.

Does the following code use the right syntax?

# 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
library(TAM)
mod <- tam.mml.2pl(resp = data, xsi.fixed = xsi.fixed, B.fixed = b.fixed)
Share Improve this question edited Mar 18 at 9:21 Julien asked Mar 17 at 15:55 JulienJulien 1,7921 gold badge14 silver badges32 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

OP needs to fix the loading for every category of the respective items, whereas the category column is a counter starting with 1. That ist, the category column can't be 0. Note that OP also needs to free the variance of the person distribution for estimation if the discrimination parameters are fixed.

Try

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, 
  est.variance = TRUE)
mod$B
mod$variance

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论