## Dichotomous models ##
# Loading the 'tcals' parameters
data(tcals)
# Item bank creation with 'tcals' item parameters
bank <- as.matrix(tcals[,1:4])
# Random selection of 4 starting items
startItems(bank, seed = 1, nrItems = 4)
# Random selection of 4 starting items without fixing the seed
startItems(bank, seed = NA, nrItems = 4)
startItems(bank, seed = NA, nrItems = 4) # may provide a different result!
# Selection of the first 5 starting items
startItems(bank, fixItems = 1:5)
# Selecting 1 starting item, initial ability estimate is 0
startItems(bank)
# Selecting 3 starting items for ability levels -1, 0 and 2
startItems(bank, theta = c(-1, 0, 2))
# Same with 5 randomesque items per theta value
startItems(bank, theta = c(-1, 0, 2), randomesque = 5)
# 5 randomesque items per theta value, with fixed random seed number
startItems(bank, theta = c(-1, 0, 2), randomesque = 5, random.seed = 1)
# Idem but with 'bOpt' criterion
startItems(bank, theta = c(-1, 0, 2), startSelect = "bOpt")
# Selecting only the first 10 items as available items
avail <- c(rep(1, 10), rep(0, nrow(bank)-10))
startItems(bank, theta = c(-1, 0, 2), nAvailable = avail)
## Not run:
# # Selecting too many items among available ones
# startItems(bank, nrItems = 11, theta = 2, halfRange = 3, nAvailable = avail)
# ## End(Not run)
## Polytomous models ##
# Generation of an item bank under GRM with 100 items and at most 4 categories
m.GRM <- genPolyMatrix(100, 4, "GRM")
m.GRM <- as.matrix(m.GRM)
# Random selection of 4 starting items
startItems(m.GRM, model = "GRM", seed = 1, nrItems = 4)
# Selection of the first 5 starting items
startItems(m.GRM, model = "GRM", fixItems = 1:5)
# Selecting 3 starting items for theta values -1, 0 and 2
startItems(m.GRM, model = "GRM", theta = c(-1, 0, 2))
## Not run:
#
# # Idem but with 'bOpt' criterion
# startItems(m.GRM, model = "GRM", nrItems = 3, theta = 1, halfRange = 2,
# startSelect = "bOpt")
# ## End(Not run)
# Selecting only the first 10 items as available items
avail <- c(rep(1, 10), rep(0, nrow(m.GRM)-10))
startItems(m.GRM, model = "GRM", theta = c(-1, 0, 2),
nAvailable = avail)
## Not run:
#
# # Selecting too many items among available ones
# startItems(m.GRM, model = "GRM", theta = seq(from = -2, to = 2, length = 11),
# nAvailable = avail)
# ## End(Not run)
# Generation of an item bank under PCM with 20 items and 4 categories
m.PCM <- genPolyMatrix(20, 4, "PCM", same.nrCat = TRUE)
m.PCM <- as.matrix(m.PCM)
# Random selection of 4 starting items
startItems(m.PCM, model = "PCM", seed = 1, nrItems = 4)
# Selection of the first 5 starting items
startItems(m.PCM, model = "PCM", fixItems = 1:5)
# Selecting 3 starting items for theta values -1, 0 and 2
startItems(m.PCM, model = "PCM", theta = c(-1, 0, 2))
## Not run:
#
# # Idem but with 'bOpt' criterion
# startItems(m.PCM, model = "PCM", theta = c(-1, 0, 2), startSelect = "bOpt")
# ## End(Not run)
# Selecting only the first 10 items as available items
avail <- c(rep(1, 10), rep(0, nrow(m.PCM)-10))
startItems(m.PCM, model = "PCM", theta = c(-1, 0, 2), nAvailable = avail)
## Not run:
#
# # Selecting too many items among available ones
# startItems(m.PCM, model = "PCM", theta = seq(from = -2, to = 2, length = 11),
# nAvailable = avail)
# ## End(Not run)
Run the code above in your browser using DataLab