# NOT RUN {
################################################################################
# responses to 10 items using 5-point Likert scale
# with respect to the Bockenholt's IRTree (i.e. "sequential") "MAE" model
# 1) make scoring matrix
sM <- make_scoring_matrix_aem(5, "mae")
# 2) generate items' slopes:
# slopes on the 'middle" and "extreme" latent traits set to 1 for all items
# and slopes on the "acquiescence" latent trait generated from a log-normal
# distribution with expected value of about 1.02 and standard deviation of
# about 0.21
slopes <- cbind(generate_slopes(10, sM[, 1, drop = FALSE], 1),
generate_slopes(10, sM[, 2, drop = FALSE], FUN = rlnorm,
meanlog = 0,
sdlog = 0.2),
generate_slopes(10, sM[, 3, drop = FALSE], 1))
# 3) generate items' intercepts:
# intercepts generated from the uniform distribution with limits set to
# -1.5 and 1.5
intercepts <- generate_intercepts(10, sM, runif,
list(min = -1.5,
max = 1.5))
# 4) call `make_test()`
# (for IRTree mode must be set to "sequential")
test <- make_test(sM, slopes, intercepts, "sequential")
################################################################################
# responses to 20 items using 5-point Likert scale
# with respect to the Plieninger's "simultaneous" (partialy-compensatory) model
# 1) make scoring matrix
sM <- make_scoring_matrix_aem(5, "simultaneous")
# 2) generate items' slopes:
# slopes on the 'middle", "extreme" and "acquiescence" latent traits
# set to 1 for all items and slopes on the "intensity" latent trait generated
# from a normal distribution with expected value of 1 and standard deviation
# of 0.3
slopes <- cbind(generate_slopes(20, sM[, 1, drop = FALSE], FUN = rnorm,
mean = 1, sd = 0.3),
generate_slopes(20, sM[, -1], 1))
# 3) generate items' thresholds:
# thresholds generated from the normal distributon of items' (general)
# diificulty wit expected value of 0 and standardo deviation of 1.5 and the
# uniform distribution with limits -1 and 1 of categories' thresholds
# relative to item's difficulty
intercepts <- generate_intercepts(20, sM, FUNd = rnorm, FUNt = runif,
argsd = list(mean = 0, sd = 1.5),
argst = list(min = -1, max = 1))
# 4) call `make_test()`
test <- make_test(sM, slopes, intercepts, "simultaneous")
# }
Run the code above in your browser using DataLab