Skip to content

One booklet 1PL items

tmatta edited this page Oct 16, 2017 · 4 revisions

We examined item parameter recovery under the following conditions: 1 (IRT model) x 3 (IRT R packages) x 3 (sample sizes) x 4 (test lengths) x 1 (test booklet)


  • One IRT model was included: Rasch model
    • Item parameters were randomly generated
    • The bounds of the item difficulty parameter, b, are constrained to b_bounds = (-2, 2) where -2 is the lowest generating value and 2 is the highest generating value
  • Three IRT R packages were evaluated: TAM (version 2.4-9), mirt (version 1.25), and ltm (version 1.0-0)
  • Three sample sizes were used: 500, 1000, and 5000
    • Simulated samples were based on one ability level from distribution N(0, 1)
  • Four test lengths were used: 40, 60, 80, and 100
  • A single booklet was used

  • One hundred replications were used for each condition for the calibration

  • Summary of item parameter recovery:
    • TAM, mirt, and ltm demonstrated a similar level of accuracy
    • b-parameter recovered well, with correlation ranging from 0.996 to 1, with bias ranging from -0.009 to 0, and with RMSE ranging from 0.037 to 0.131
    • Sample sizes of 5000 consistently produced the most accurate results
    • Four levels of test lengths performed very similarly

 

# Load libraries
if(!require(lsasim)){  
  install.packages("lsasim")
  library(lsasim) #version 1.0.1
}

if(!require(mirt)){  
  install.packages("mirt")
  library(mirt) #version 1.25
}

if(!require(TAM)){
  install.packages("TAM")
  library(TAM) #version 2.4-9
}

if(!require(ltm)){
  install.packages("ltm")
  library(ltm) #version 1.0-0
}
# Set up conditions
N.cond <- c(500, 1000, 5000) #number of sample sizes
I.cond <- c(40, 60, 80, 100) #number of items 
K.cond  <- 1                 #number of booklets  

# Set up number of replications
reps <- 100

# Create space for outputs
results <- NULL
#==============================================================================#
# START SIMULATION
#==============================================================================#

for (N in N.cond) { #sample size
  
  for (I in I.cond) { #number of items
    
    # generate item parameters for a Rasch model
    set.seed(4363) # fix item parameters across replications
    item_pool <- lsasim::item_gen(n_1pl = I, 
                                  thresholds = 1, 
                                  b_bounds = c(-2, 2))
    
    for (K in K.cond) { #number of booklets
      
      for (r in 1:reps) { #replication
        
        #------------------------------------------------------------------------------#
        # Data simulation
        #------------------------------------------------------------------------------#
        
        set.seed(8088*(r+1))
        
        # generate thetas
        theta <- rnorm(N, mean=0, sd=1)
        
        # assign items to block
        block_bk1 <- lsasim::block_design(n_blocks = K, 
                                          item_parameters = item_pool)
        
        #assign block to booklet
        book_bk1 <- lsasim::booklet_design(item_block_assignment = 
                                             block_bk1$block_assignment,
                                           book_design = matrix(K))
        #assign booklet to subjects
        book_samp <- lsasim::booklet_sample(n_subj = N, 
                                            book_item_design = book_bk1, 
                                            book_prob = NULL)
        
        # generate item responses 
        cog <- lsasim::response_gen(subject = book_samp$subject, 
                                    item = book_samp$item, 
                                    theta = theta, 
                                    b_par = item_pool$b)
        
        # extract item responses (excluding "subject" column)
        resp <- cog[, c(1:I)]
        
        #------------------------------------------------------------------------------#
        # Item calibration
        #------------------------------------------------------------------------------#
        
        # fit Rasch model using mirt package
        mirt.mod <- NULL
        mirt.mod <- mirt::mirt(resp, 1, itemtype = 'Rasch', verbose = F)
        
        # fit Rasch model using TAM package
        tam.mod <- NULL
        tam.mod <- TAM::tam.mml(resp)
        
        # fit Rasch model using ltm package 
        ltm.mod <- NULL
        ltm.mod <- ltm::rasch(resp, constraint = cbind(ncol(resp) + 1, 1), IRT.param =T ) 
        
        #------------------------------------------------------------------------------#
        # Item parameter extraction
        #------------------------------------------------------------------------------#
        
        # extract b in mirt package
        mirt_b <- coef(mirt.mod, IRTpars = TRUE, simplify=TRUE)$items[,"b"]
        
        # extract xsi.item (item difficulty) in TAM pacakge
        tam_b <- tam.mod$item$xsi.item
        
        # extract Dffclt in ltm package
        ltm_b <- data.frame(coef(ltm.mod))$Dffclt
        
        #------------------------------------------------------------------------------#
        # Item parameter recovery
        #------------------------------------------------------------------------------#
        
        # summarize results
        itempars <- data.frame(matrix(c(N, I, K, r), nrow = 1))
        colnames(itempars) <- c("N", "I", "K", "rep")
        
        # calculate corr, bias, RMSE for item parameters in mirt pacakge
        itempars$corr_mirt_b <- cor( item_pool$b, mirt_b)
        itempars$bias_mirt_b <- mean( mirt_b - item_pool$b )
        itempars$RMSE_mirt_b <- sqrt(mean( ( mirt_b - item_pool$b)^2 )) 
        
        # calculate corr, bias, RMSE for item parameters in TAM pacakge
        itempars$corr_tam_b <- cor( item_pool$b, tam_b)
        itempars$bias_tam_b <- mean( tam_b - item_pool$b )
        itempars$RMSE_tam_b <- sqrt(mean( ( tam_b - item_pool$b)^2 )) 
        
        # calculate corr, bias, RMSE for item parameters in ltm pacakge
        itempars$corr_ltm_b <- cor( item_pool$b, ltm_b)
        itempars$bias_ltm_b <- mean( ltm_b - item_pool$b )
        itempars$RMSE_ltm_b <- sqrt(mean( ( ltm_b - item_pool$b)^2 )) 
        
        # combine results
        results <- rbind(results, itempars)
        
      }
    }
  }
}

 

  • Correlation, bias, and RMSE for item parameter recovery in mirt package

 

mirt_recovery <- aggregate(cbind(corr_mirt_b, bias_mirt_b, RMSE_mirt_b) ~ N + I, 
                            data=results, mean, na.rm=TRUE)
names(mirt_recovery) <- c("Sample Size", "Test Length", 
                         "corr_b", "bias_b", "RMSE_b")
round(mirt_recovery, 3)
##    Sample Size Test Length corr_b bias_b RMSE_b
## 1          500          40  0.996 -0.007  0.118
## 2         1000          40  0.998 -0.007  0.080
## 3         5000          40  1.000 -0.003  0.037
## 4          500          60  0.996 -0.006  0.119
## 5         1000          60  0.998 -0.006  0.082
## 6         5000          60  1.000 -0.002  0.037
## 7          500          80  0.996 -0.006  0.117
## 8         1000          80  0.998 -0.007  0.082
## 9         5000          80  1.000 -0.002  0.037
## 10         500         100  0.996 -0.006  0.117
## 11        1000         100  0.998 -0.007  0.082
## 12        5000         100  1.000 -0.002  0.037

 

  • Correlation, bias, and RMSE for item parameter recovery in TAM package

 

tam_recovery <- aggregate(cbind(corr_tam_b, bias_tam_b, RMSE_tam_b) ~ N + I, 
                           data=results, mean, na.rm=TRUE)
names(tam_recovery) <- c("Sample Size", "Test Length", 
                         "corr_b", "bias_b", "RMSE_b")
round(tam_recovery, 3)
##    Sample Size Test Length corr_b bias_b RMSE_b
## 1          500          40  0.996 -0.006  0.118
## 2         1000          40  0.998 -0.006  0.080
## 3         5000          40  1.000 -0.002  0.037
## 4          500          60  0.996 -0.004  0.119
## 5         1000          60  0.998 -0.006  0.082
## 6         5000          60  1.000 -0.001  0.037
## 7          500          80  0.996 -0.006  0.118
## 8         1000          80  0.998 -0.008  0.083
## 9         5000          80  1.000 -0.003  0.038
## 10         500         100  0.996 -0.001  0.124
## 11        1000         100  0.998 -0.007  0.087
## 12        5000         100  1.000 -0.002  0.039

 

  • Correlation, bias, and RMSE for item parameter recovery in ltm package

 

ltm_recovery <- aggregate(cbind(corr_ltm_b, bias_ltm_b, RMSE_ltm_b) ~ N + I, 
                          data=results, mean, na.rm=TRUE)
names(ltm_recovery) <- c("Sample Size", "Test Length", 
                         "corr_b", "bias_b", "RMSE_b")
round(ltm_recovery, 3)
##    Sample Size Test Length corr_b bias_b RMSE_b
## 1          500          40  0.996 -0.007  0.118
## 2         1000          40  0.998 -0.007  0.080
## 3         5000          40  1.000 -0.002  0.037
## 4          500          60  0.996 -0.003  0.120
## 5         1000          60  0.998 -0.007  0.083
## 6         5000          60  1.000 -0.002  0.037
## 7          500          80  0.996 -0.004  0.122
## 8         1000          80  0.998 -0.008  0.085
## 9         5000          80  1.000 -0.002  0.039
## 10         500         100  0.996 -0.008  0.131
## 11        1000         100  0.998 -0.009  0.092
## 12        5000         100  1.000  0.000  0.041