theta_EAP() and theta_EAP_matrix() are functions for calculating a theta estimate using EAP (expected a posteriori) method.

theta_EAP(theta_grid, item_parm, resp, ncat, model, prior, prior_parm)

theta_EAP_matrix(theta_grid, item_parm, resp, ncat, model, prior, prior_parm)

Arguments

theta_grid

theta quadrature points.

item_parm

a matrix containing item parameters.

resp

responses on each item. Must be a vector for theta_EAP(), and a matrix for theta_EAP_matrix(). Each row should represent an examinee.

ncat

a vector containing the number of response categories of each item.

model

a vector indicating item models of each item, using

  • 1: 1PL model

  • 2: 2PL model

  • 3: 3PL model

  • 4: PC model

  • 5: GPC model

  • 6: GR model

prior

an integer indicating the type of prior distribution, using

  • 1: normal distribution

  • 2: uniform distribution

prior_parm

a vector containing parameters for the prior distribution.

Details

theta_EAP() and theta_EAP_matrix() are designed for multiple items.

theta_EAP() is designed for one examinee, and theta_EAP_matrix() is designed for multiple examinees.

Currently supports unidimensional models.

Examples

# item parameters
item_parm <- matrix(c(
  1, NA,   NA,
  1,  2,   NA,
  1,  2, 0.25,
  0,  1,   NA,
  2,  0,    1,
  2,  0,    2),
  nrow = 6,
  byrow = TRUE
)

ncat  <- c(2, 2, 2, 3, 3, 3)
model <- c(1, 2, 3, 4, 5, 6)

# simulate response
item_parm <- as.data.frame(item_parm)
item_parm <- cbind(101:106, 1:6, item_parm)
pool <- loadItemPool(item_parm)
true_theta <- seq(-3, 3, 1)
resp <- simResp(pool, true_theta)

theta_grid <- matrix(seq(-3, 3, .1), , 1)

theta_EAP(theta_grid, pool@ipar, resp[1, ], ncat, model, 1, c(1, 2))
#> $theta
#> [1] -1.536257
#> 
#> $se
#> [1] 0.7754473
#> 
theta_EAP_matrix(theta_grid, pool@ipar, resp, ncat, model, 1, c(1, 2))
#> [[1]]
#> [[1]]$theta
#> [1] -1.536257
#> 
#> [[1]]$se
#> [1] 0.7754473
#> 
#> 
#> [[2]]
#> [[2]]$theta
#> [1] -0.4914265
#> 
#> [[2]]$se
#> [1] 0.6365066
#> 
#> 
#> [[3]]
#> [[3]]$theta
#> [1] -0.1161107
#> 
#> [[3]]$se
#> [1] 0.57629
#> 
#> 
#> [[4]]
#> [[4]]$theta
#> [1] -0.4914265
#> 
#> [[4]]$se
#> [1] 0.6365066
#> 
#> 
#> [[5]]
#> [[5]]$theta
#> [1] 1.856916
#> 
#> [[5]]$se
#> [1] 0.556842
#> 
#> 
#> [[6]]
#> [[6]]$theta
#> [1] 2.345399
#> 
#> [[6]]$se
#> [1] 0.4701189
#> 
#> 
#> [[7]]
#> [[7]]$theta
#> [1] 2.532291
#> 
#> [[7]]$se
#> [1] 0.3933497
#> 
#>