Skip to content

Multiple booklets PC items

tmatta edited this page Oct 17, 2017 · 3 revisions

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


  • One IRT model was included: PC 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.
  • Two IRT R packages were evaluated: TAM (version 2.4-9) and mirt (version 1.25)
  • 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
  • Three test booklets were used: 5, 10, and 15 booklets

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

  • Summary of item parameter recovery:
    • TAM and mirt demonstrated a similar level of accuracy
    • b1-parameter recovered well, with correlation ranging from 0.877 to 0.996, with bias ranging from -0.021 to -0.001, and with RMSE ranging from 0.064 to 0.382
    • b2-parameter recovered well, with correlation ranging from 0.889 to 0.997, with bias ranging from -0.007 to 0.015, and with RMSE ranging from 0.063 to 0.383
    • For b1- and b2-parameters, sample sizes of 5000 consistently produced the most accurate results
    • For b1- and b2-parameters, four levels of test lengths performed very similarly
    • For b1- and b2-parameters, , when number of booklets increased, recovery accuracy decreased slightly

 

# 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
}
# 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 <- c(5, 10, 15)       #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 PC model
    set.seed(4366) # fix item parameters across replications
    item_pool <- lsasim::item_gen(n_1pl = I, 
                                  thresholds = 2, 
                                  b_bounds = c(-2, 2))
    
    for (K in K.cond) { #number of booklets
      
      for (r in 1:reps) { #replication
        
        set.seed(8088*(r+4))
        
        # generate thetas
        theta <- rnorm(N, mean=0, sd=1)
        
        # assign items to blocks
        blocks <- lsasim::block_design(n_blocks = K, 
                                       item_parameters = item_pool, 
                                       item_block_matrix = NULL)
        
        #assign blocks to booklets
        books <- lsasim::booklet_design(item_block_assignment = 
                                          blocks$block_assignment, 
                                        book_design = NULL)
        
        #assign booklets to subjects 
        book_samp <- lsasim::booklet_sample(n_subj = N, 
                                            book_item_design = books, 
                                            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,
                                    d_par = list(item_pool$d1,
                                                 item_pool$d2))
        
        # extract item responses (excluding "subject" column)
        resp <- cog[, c(1:I)]
        
        #------------------------------------------------------------------------------#
        # Item calibration
        #------------------------------------------------------------------------------#
        
        # fit PC model using mirt package
        mirt.mod <- NULL
        mirt.mod <- mirt::mirt(resp, 1, itemtype = 'Rasch', verbose = F, 
                               technical = list( NCYCLES = 500))
        
        # fit PC model using TAM package
        tam.mod <- NULL
        tam.mod <- TAM::tam.mml(resp, irtmodel = "PCM2", control = list(maxiter = 200))

        #------------------------------------------------------------------------------#
        # Item parameter extraction
        #------------------------------------------------------------------------------#
        
        # extract b1, b2 in mirt package
        mirt_b1 <- coef(mirt.mod, IRTpars = TRUE, simplify=TRUE)$items[,"b1"]
        mirt_b2 <- coef(mirt.mod, IRTpars = TRUE, simplify=TRUE)$items[,"b2"]
        
        # convert TAM output into PCM parametrization
        tam_b1 <- tam.mod$item$AXsi_.Cat1
        tam_b2 <- (tam.mod$item$AXsi_.Cat2) - (tam.mod$item$AXsi_.Cat1)
        
        #------------------------------------------------------------------------------#
        # Item parameter recovery
        #------------------------------------------------------------------------------#
        
        # summarize results
        itempars <- data.frame(matrix(c(N, I, K, r), nrow=1))
        colnames(itempars) <- c("N", "I", "K", "rep")
        
        # retrieve generated item parameters        
        genPC.b1 <- item_pool$b + item_pool$d1
        genPC.b2 <- item_pool$b + item_pool$d2
        
        # calculate corr, bias, RMSE for item parameters in mirt pacakge
        itempars$corr_mirt_b1 <- cor( genPC.b1, mirt_b1)
        itempars$bias_mirt_b1 <- mean( mirt_b1 - genPC.b1 )
        itempars$RMSE_mirt_b1 <- sqrt(mean( ( mirt_b1 - genPC.b1 )^2 )) 
        
        itempars$corr_mirt_b2 <- cor( genPC.b2, mirt_b2)
        itempars$bias_mirt_b2 <- mean( mirt_b2 - genPC.b2 )
        itempars$RMSE_mirt_b2 <- sqrt(mean( ( mirt_b2 - genPC.b2 )^2 )) 
        
        # calculate corr, bias, RMSE for item parameters in TAM pacakge
        itempars$corr_tam_b1 <- cor( genPC.b1, tam_b1)
        itempars$bias_tam_b1 <- mean( tam_b1 - genPC.b1 )
        itempars$RMSE_tam_b1 <- sqrt(mean( ( tam_b1 - genPC.b1 )^2 )) 
        
        itempars$corr_tam_b2 <- cor( genPC.b2, tam_b2)
        itempars$bias_tam_b2 <- mean( tam_b2 - genPC.b2 )
        itempars$RMSE_tam_b2 <- sqrt(mean( ( tam_b2 - genPC.b2 )^2 )) 
        
        # combine results
        results <- rbind(results, itempars)
        
      }
    }
  }
}

 

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

 

mirt_recovery <- aggregate(cbind(corr_mirt_b1, bias_mirt_b1, RMSE_mirt_b1,
                                 corr_mirt_b2, bias_mirt_b2, RMSE_mirt_b2) ~ N + I + K, 
                            data=results, mean, na.rm=TRUE)
names(mirt_recovery) <- c("N", "I", "K",
                          "corr_b1", "bias_b1", "RMSE_b1",
                          "corr_b2", "bias_b2", "RMSE_b2")
round(mirt_recovery, 3)
##       N   I  K corr_b1 bias_b1 RMSE_b1 corr_b2 bias_b2 RMSE_b2
## 1   500  40  5   0.961  -0.004   0.200   0.966  -0.006   0.203
## 2  1000  40  5   0.979  -0.007   0.144   0.983  -0.001   0.144
## 3  5000  40  5   0.996  -0.003   0.065   0.997  -0.003   0.063
## 4   500  60  5   0.958  -0.016   0.208   0.962   0.004   0.208
## 5  1000  60  5   0.979  -0.008   0.143   0.981  -0.006   0.144
## 6  5000  60  5   0.996  -0.002   0.064   0.996  -0.001   0.064
## 7   500  80  5   0.958  -0.009   0.205   0.965   0.003   0.203
## 8  1000  80  5   0.979  -0.010   0.143   0.981  -0.004   0.144
## 9  5000  80  5   0.996  -0.002   0.065   0.996  -0.003   0.064
## 10  500 100  5   0.960  -0.005   0.202   0.966  -0.003   0.206
## 11 1000 100  5   0.979  -0.011   0.144   0.982  -0.003   0.147
## 12 5000 100  5   0.996  -0.002   0.064   0.996  -0.003   0.065
## 13  500  40 10   0.920  -0.009   0.298   0.932  -0.007   0.301
## 14 1000  40 10   0.957  -0.014   0.210   0.964  -0.004   0.207
## 15 5000  40 10   0.991  -0.004   0.092   0.993   0.000   0.092
## 16  500  60 10   0.918  -0.014   0.299   0.927   0.006   0.296
## 17 1000  60 10   0.957  -0.011   0.208   0.961  -0.005   0.207
## 18 5000  60 10   0.991  -0.001   0.092   0.992  -0.003   0.092
## 19  500  80 10   0.920  -0.018   0.296   0.927   0.008   0.296
## 20 1000  80 10   0.957  -0.010   0.207   0.962  -0.001   0.207
## 21 5000  80 10   0.991  -0.002   0.091   0.992  -0.001   0.092
## 22  500 100 10   0.919  -0.013   0.298   0.930   0.002   0.303
## 23 1000 100 10   0.959  -0.009   0.204   0.965  -0.005   0.205
## 24 5000 100 10   0.991  -0.003   0.092   0.993   0.000   0.092
## 25  500  40 15   0.882  -0.006   0.373   0.898   0.000   0.374
## 26 1000  40 15   0.937  -0.021   0.257   0.946   0.009   0.259
## 27 5000  40 15   0.987  -0.003   0.113   0.989  -0.001   0.112
## 28  500  60 15   0.879  -0.011   0.377   0.893   0.007   0.375
## 29 1000  60 15   0.937  -0.013   0.255   0.944   0.001   0.257
## 30 5000  60 15   0.987  -0.004   0.110   0.988  -0.002   0.112
## 31  500  80 15   0.878  -0.012   0.378   0.889   0.007   0.383
## 32 1000  80 15   0.936  -0.013   0.253   0.942   0.000   0.260
## 33 5000  80 15   0.986  -0.003   0.114   0.988  -0.003   0.114
## 34  500 100 15   0.884  -0.019   0.368   0.899   0.015   0.373
## 35 1000 100 15   0.936  -0.012   0.259   0.946  -0.002   0.258
## 36 5000 100 15   0.987  -0.003   0.112   0.989  -0.002   0.113

 

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

 

tam_recovery <- aggregate(cbind(corr_tam_b1, bias_tam_b1, RMSE_tam_b1,
                                corr_tam_b2, bias_tam_b2, RMSE_tam_b2) ~ N + I + K, 
                           data=results, mean, na.rm=TRUE)
names(tam_recovery) <- c("N", "I", "K",
                         "corr_b1", "bias_b1", "RMSE_b1",
                         "corr_b2", "bias_b2", "RMSE_b2")
round(tam_recovery, 3)
##       N   I  K corr_b1 bias_b1 RMSE_b1 corr_b2 bias_b2 RMSE_b2
## 1   500  40  5   0.961  -0.004   0.200   0.966  -0.006   0.203
## 2  1000  40  5   0.979  -0.007   0.144   0.983  -0.001   0.144
## 3  5000  40  5   0.996  -0.003   0.065   0.997  -0.003   0.063
## 4   500  60  5   0.958  -0.016   0.208   0.962   0.004   0.209
## 5  1000  60  5   0.979  -0.008   0.143   0.981  -0.007   0.144
## 6  5000  60  5   0.996  -0.003   0.064   0.996  -0.002   0.064
## 7   500  80  5   0.958  -0.010   0.205   0.965   0.003   0.203
## 8  1000  80  5   0.979  -0.011   0.143   0.981  -0.003   0.144
## 9  5000  80  5   0.996  -0.002   0.065   0.996  -0.002   0.065
## 10  500 100  5   0.960  -0.010   0.208   0.966  -0.007   0.211
## 11 1000 100  5   0.979  -0.012   0.147   0.982  -0.003   0.149
## 12 5000 100  5   0.996  -0.001   0.065   0.996   0.000   0.066
## 13  500  40 10   0.920  -0.009   0.298   0.932  -0.007   0.301
## 14 1000  40 10   0.957  -0.014   0.210   0.964  -0.004   0.207
## 15 5000  40 10   0.991  -0.004   0.092   0.993   0.000   0.092
## 16  500  60 10   0.918  -0.014   0.299   0.927   0.005   0.296
## 17 1000  60 10   0.957  -0.011   0.208   0.961  -0.005   0.207
## 18 5000  60 10   0.991  -0.001   0.092   0.992  -0.003   0.092
## 19  500  80 10   0.920  -0.017   0.296   0.927   0.009   0.296
## 20 1000  80 10   0.957  -0.010   0.207   0.962  -0.001   0.207
## 21 5000  80 10   0.991  -0.002   0.091   0.992  -0.002   0.092
## 22  500 100 10   0.919  -0.013   0.298   0.930   0.002   0.303
## 23 1000 100 10   0.959  -0.010   0.204   0.965  -0.005   0.205
## 24 5000 100 10   0.991  -0.003   0.092   0.993   0.000   0.092
## 25  500  40 15   0.882  -0.006   0.373   0.898   0.000   0.374
## 26 1000  40 15   0.937  -0.021   0.257   0.946   0.009   0.259
## 27 5000  40 15   0.987  -0.003   0.113   0.989  -0.001   0.112
## 28  500  60 15   0.879  -0.011   0.377   0.893   0.007   0.375
## 29 1000  60 15   0.937  -0.013   0.255   0.944   0.001   0.257
## 30 5000  60 15   0.987  -0.004   0.110   0.988  -0.002   0.112
## 31  500  80 15   0.877  -0.012   0.382   0.889   0.008   0.383
## 32 1000  80 15   0.936  -0.013   0.253   0.942   0.000   0.260
## 33 5000  80 15   0.986  -0.003   0.114   0.988  -0.003   0.114
## 34  500 100 15   0.884  -0.019   0.368   0.899   0.015   0.373
## 35 1000 100 15   0.936  -0.012   0.259   0.946  -0.002   0.258
## 36 5000 100 15   0.987  -0.003   0.112   0.989  -0.002   0.113