loadItemPool is a data loading function for creating an item_pool object. loadItemPool can read item parameters and standard errors from a data.frame or a .csv file.

loadItemPool(ipar, ipar_se = NULL, unique = FALSE)

Arguments

ipar

item parameters. Can be a data.frame or the file path of a .csv file. The content should at least include columns 'ID' and 'MODEL'.

ipar_se

(optional) standard errors. Can be a data.frame or the file path of a .csv file.

unique

if TRUE, item IDs must be unique to create a valid item_pool object. (default = FALSE)

Value

loadItemPool returns an item_pool object.

  • ni the number of items in the pool.

  • max_cat the maximum number of response categories across all items in the pool.

  • index the numeric item index of each item.

  • id the item ID string of each item.

  • model the object class names of each item representing an item model type. Can be item_1PL, item_2PL, item_3PL, item_PC, item_GPC, or item_GR.

  • NCAT the number of response categories of each item.

  • parms a list containing the item object of each item.

  • ipar a matrix containing all item parameters.

  • se a matrix containing all item parameter standard errors. The values will be 0 if the argument ipar_se was not supplied.

  • raw the original input ipar argument used to create this object.

  • raw_se the original input ipar_se argument used to create this object. If the argument was not supplied, this will be in the same structure with the ipar argument but the item parameter values will be filled with 0s.

  • unique the original input unique argument used to create this object.

Examples

## Read from data.frame:
itempool_science <- loadItemPool(itempool_science_data)

## Read from file: write to tempdir() for illustration and clean afterwards
f <- file.path(tempdir(), "itempool_science.csv")
write.csv(itempool_science_data, f, row.names = FALSE)
itempool_science <- loadItemPool(f)
file.remove(f)
#> [1] TRUE