library(learnr) library(learnSEM) knitr::opts_chunk$set(echo = FALSE) library(mirt) library(ltm) data(dirtdata) data(mirtdata) mirtdata$q5 <- 8 - mirtdata$q5 mirtdata$q8 <- 8 - mirtdata$q8 mirtdata$q13 <- 8 - mirtdata$q13
Item Response Theory is a latent trait analysis with a different focus traditionally used in understanding how a test performs. We will examine both dichotomous (yes/no) and polytomous (multiple options) scales to determine each item's characteristics. The learning outcomes are:
You can use vignette("lecture_irt", "learnSEM")
to view these notes in R.
In this next section, you will answer questions using the R code blocks provided. Be sure to use the solution
option to see the answer if you need it!
Please enter your name for submission. If you do not need to submit, just type anything you'd like in this box.
question_text( "Student Name:", answer("Your Name", correct = TRUE), incorrect = "Thanks!", try_again_button = "Modify your answer", allow_retry = TRUE )
The included dataset includes data from an Educational Psychology Test scored as 0 (answered incorrectly) and 1 (answered correctly). The data has been imported for you.
data(dirtdata) head(dirtdata)
Include a 2PL calculated on just columns V2 through V5. Save the model as edu.model
. Use the coef()
function to examine the difficulty and discrimination parameters.
edu.model <- ltm(dirtdata ~ z1, IRT.param = TRUE) coef(edu.model)
Include the ICC and TIF plots to view all the items and overall test information at once.
edu.model <- ltm(dirtdata ~ z1, IRT.param = TRUE)
plot(edu.model, type = "IIC") plot(edu.model, type = "IIC", items = 0)
Include the 3PL model as edu2.model
. Use the coef()
function to examine the difficulty, discrimination, and guessing parameters. Name this model edu.model2
.
edu.model2 <- tpm(dirtdata, type="latent.trait", IRT.param = TRUE) coef(edu.model2)
Include the ICC and TIF plots to view all the items and overall test information at once.
edu.model2 <- tpm(dirtdata, type="latent.trait", IRT.param = TRUE)
plot(edu.model2, type="ICC") plot(edu.model2, type = "IIC", items = 0)
Use the anova()
function to compare the two models.
edu.model <- ltm(dirtdata ~ z1, IRT.param = TRUE) edu.model2 <- tpm(dirtdata, type="latent.trait", IRT.param = TRUE)
anova(edu.model, edu.model2)
question_text( "Which model was better? Does it appear that the guessing parameter adds something useful to the model? ", answer("Nope! The 2PL is a better representation.", correct = TRUE), incorrect = "Nope! The 2PL is a better representation.", try_again_button = "Modify your answer", allow_retry = TRUE )
question_text( "Which items would be considered good items based on discrimination?", answer("Nearly all are good discriminators, but pretty easy.", correct = TRUE), incorrect = "Nearly all are good discriminators, but pretty easy.", try_again_button = "Modify your answer", allow_retry = TRUE )
Load the assignment_mirt data below. You should reverse code items 5, 8, and 13 using 8 - columns
to ensure all items are in the same direction. The scale included examines evaluations of job candidates rated on 15 different qualities.
data(mirtdata) head(mirtdata)
Create a graded partial credit model to analyze the scale, and save this model as gpcm.model
. Include the coef()
for the model to help you answer the questions below.
gpcm.model <- mirt(data = mirtdata, model = 1, itemtype = "gpcm") coef(gpcm.model, IRTpars = T)
Include the ICC and TIF plots to view all the items and overall test information at once.
gpcm.model <- mirt(data = mirtdata, model = 1, itemtype = "gpcm")
plot(gpcm.model, type = "trace") plot(gpcm.model, type = "info")
question_text( "Examine the items. Do they appear ordered where each answer function is ordered correctly from 1 to 7?", answer("Yes, they mostly appear ordered.", correct = TRUE), incorrect = "Yes, they mostly appear ordered.", try_again_button = "Modify your answer", allow_retry = TRUE )
question_text( "Examine the items. Do we need all 7 items on this scale? (i.e., do they all have the probability of being the most likely answer choice?)", answer("Unlikely, maybe only four points.", correct = TRUE), incorrect = "Unlikely, maybe only four points.", try_again_button = "Modify your answer", allow_retry = TRUE )
question_text( "Which items indicate good discrimination?", answer("Pretty much all of them but 8 and 13.", correct = TRUE), incorrect = "Pretty much all of them but 8 and 13.", try_again_button = "Modify your answer", allow_retry = TRUE )
On this page, you will create the submission for your instructor (if necessary). Please copy this report and submit using a Word document or paste into the text window of your submission page. Click "Generate Submission" to get your work!
encoder_logic()
encoder_ui()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.