IRT Models (Rasch, 2PL, & 3PL) in R with ltm package
8,891
Published 2020-12-14
Tutorial of how to fit three unidimensional binary response Item Response Theory (IRT) models (Rasch, 2PL, and 3PL models) using the ltm package in R. The dataset used were responses to the 25-Item online IQ test modeled after Raven Progressive Matrices (RPM).
All Comments (15)
-
Here is the rcode: #where to download IQ1 dataset # openpsychometrics.org/_rawdata/ #load dataset download IQ1 <- read.csv(file.choose()) #select questions only IQbin<-IQ1[,1:25] #binary responses IQbin[IQbin<10]<-0 IQbin[IQbin==10]<-1 #fit 3 binary response unidimensional IRT models library(ltm) #fit rasch model (i.e., 1PL) IRTrasch <- rasch(IQbin, IRT.param = TRUE,constraint = cbind(length(IQbin) + 1, 1)) #fit 2PL model IRT2pl <- ltm(IQbin~z1,IRT.param = TRUE) #fit 3PL model IRT3pl <- tpm(IQbin,type="latent.trait",IRT.param = TRUE) #return item parameters for each model coef(IRTrasch, prob = TRUE) coef(IRT2pl, prob = TRUE) coef(IRT3pl, prob = TRUE) #compare model fit anova(IRTrasch,IRT2pl) anova(IRT2pl,IRT3pl) #return goodness of fit of the items with chi-square test item.fit(IRT2pl) #Plot ICC's for each item plot(IRT2pl,type="ICC") #Plot ICC's for one item plot(IRT2pl,type="ICC",items=6) #Plot Test Information Function plot(IRT2pl,type="IIC",items=0) #ability estimates est<-factor.scores(IRT2pl) est$score.dat$z1[1:5] #test undimensionality #first, fit 2PL model with 2 factors IRT2pl_2 <- ltm(IQbin~z1+z2) #second, run liklihood ratio test comparing 1 to 2 factor models anova(IRT2pl,IRT2pl_2)
-
Awesome job! Thank you for doing it, it's very helpful.
-
Thank you so much for this video! I hope I can get your consultation as I work on my analysis
-
Thank you, this has been massively useful to me! You're awesome
-
Thank you for this wonderful tutorial. I wonder if I have adopted the Rasch model, can I still use the 2PL model function to check unidimensionality? Thanks!
-
Great job! thanks alot!
-
Thank you for the video. Please, I have a question about "factor.scores()", it doesn't work for me because I receive an error of a missing argument "f". Do you have any solutions to solve this problem ?
-
Amazing videos! Just a question: I have a questionnaire with a 5likert scale. Shall I use the Rasch or GRM model?
-
Really helpful video, thank you. When i run my data through all 3 models the probability of getting the item correct doesn't range between 0-1. All my numbers are greater than 1, some as high as 9. do you know what this means? how can i fix this.
-
I would appreciate it if you please tell me the r codes to estimate the students' ability by fixing the item parameters (difficulty ad discrimiation) in 2PL model.
-
do you have any tutorial on how to test irt assumptions using R?
-
Could you please let us know how to run 4PL model ? Thanks
-
Can you also make tutorial on multidimensional irt?
-
What about SEM ? Can we do it in this package ????