## example
## using a "-prm.txt" file obtained from a flexMIRT
# import the "-prm.txt" output file from flexMIRT
flex_prm <- system.file("extdata", "flexmirt_sample-prm.txt", package = "irtplay")
# read item parameters and transform them to item metadata
test_flex <- bring.flexmirt(file=flex_prm, "par")$Group1$full_df
# set theta values
theta <- seq(-3, 3, 0.1)
# compute the item category probabilities and item/test
# characteristic functions given the theta values
x <- traceline(x=test_flex, theta, D=1)
# plot TCC based on the total test form
plot(x, item.loc=NULL)
# plot ICCs for the first item (dichotomous item)
plot(x, item.loc=1, score.curve=FALSE, layout.col=2)
# plot item score curve for the first item (dichotomous item)
plot(x, item.loc=1, score.curve=TRUE)
# plot item score curves for the first six dichotomous items
# with multiple panels
plot(x, item.loc=1:6, score.curve=TRUE, overlap=FALSE)
# plot item score curve for the first six dichotomous items
# in one panel
plot(x, item.loc=1:6, score.curve=TRUE, overlap=TRUE)
# plot ICCs for the last item (polytomous item)
plot(x, item.loc=55, score.curve=FALSE, layout.col=2)
# plot item score curve for the last item (polytomous item)
plot(x, item.loc=55, score.curve=TRUE)
# plot item score curves for the last three polytomous items
# with multiple panels
plot(x, item.loc=53:55, score.curve=TRUE, overlap=FALSE)
# plot item score curves for the last three poltyomous items
# in one panel
plot(x, item.loc=53:55, score.curve=TRUE, overlap=TRUE)
Run the code above in your browser using DataLab