# NOT RUN {
## 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 toal 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 ICCs for the last item (plolytomous item)
plot(x, item.loc=55, score.curve=FALSE, layout.col=2)
# plot item score curve for the last item (plolytomous item)
plot(x, item.loc=55, score.curve=TRUE)
# }
Run the code above in your browser using DataLab