# NOT RUN {
# Loading of the verbal data
data(verbal)
attach(verbal)
# Excluding the "Anger" variable
verbal<-verbal[colnames(verbal)!="Anger"]
# Three equivalent settings of the data matrix and the group membership
# (1PL model, "ltm" engine)
difRaju(verbal, group = 25, focal.name = 1, model = "1PL")
difRaju(verbal, group = "Gender", focal.name = 1, model = "1PL")
difRaju(verbal[,1:24], group = verbal[,25], focal.name = 1, model = "1PL")
# Multiple comparisons adjustment using Benjamini-Hochberg method
difRaju(verbal, group = 25, focal.name = 1, model = "1PL", p.adjust.method = "BH")
# With signed areas
difRaju(verbal, group = 25, focal.name = 1, model = "1PL", signed = TRUE)
# With items 1 to 5 set as anchor items
difRaju(verbal, group = 25, focal.name = 1, model = "1PL", anchor = 1:5)
# (1PL model, "lme4" engine)
difRaju(verbal, group = "Gender", focal.name = 1, model = "1PL",
engine = "lme4")
# 2PL model, signed and unsigned areas
difRaju(verbal, group = "Gender", focal.name = 1, model = "2PL")
difRaju(verbal, group = "Gender", focal.name = 1, model = "2PL", signed = TRUE)
# 3PL model with all pseudo-guessing parameters constrained to 0.05
# Signed and unsigned areas
difRaju(verbal, group = "Gender", focal.name = 1, model = "3PL", c = 0.05)
difRaju(verbal, group = "Gender", focal.name = 1, model = "3PL", c = 0.05,
signed = TRUE)
# Same models, with item purification
difRaju(verbal, group = "Gender", focal.name = 1, model = "1PL", purify = TRUE)
difRaju(verbal, group = "Gender", focal.name = 1, model = "2PL", purify = TRUE)
difRaju(verbal, group = "Gender", focal.name = 1, model = "3PL", c = 0.05,
purify = TRUE)
# With signed areas
difRaju(verbal, group = "Gender", focal.name = 1, model = "1PL", purify = TRUE,
signed = TRUE)
difRaju(verbal, group = "Gender", focal.name = 1, model = "2PL", purify = TRUE,
signed = TRUE)
difRaju(verbal, group = "Gender", focal.name = 1, model = "3PL", c = 0.05,
purify = TRUE, signed = TRUE)
## Splitting the data into reference and focal groups
nF<-sum(Gender)
nR<-nrow(verbal)-nF
data.ref<-verbal[,1:24][order(Gender),][1:nR,]
data.focal<-verbal[,1:24][order(Gender),][(nR+1):(nR+nF),]
## Pre-estimation of the item parameters (1PL model, "ltm" engine)
item.1PL<-rbind(itemParEst(data.ref,model = "1PL"),
itemParEst(data.focal,model = "1PL"))
difRaju(irtParam = item.1PL,same.scale = FALSE)
## Pre-estimation of the item parameters (1PL model, "lme4" engine)
item.1PL<-rbind(itemParEst(data.ref, model = "1PL", engine = "lme4"),
itemParEst(data.focal, model = "1PL", engine = "lme4"))
difRaju(irtParam = item.1PL, same.scale = FALSE)
## Pre-estimation of the item parameters (2PL model)
item.2PL<-rbind(itemParEst(data.ref, model = "2PL"),
itemParEst(data.focal, model = "2PL"))
difRaju(irtParam = item.2PL, same.scale = FALSE)
## Pre-estimation of the item parameters (constrained 3PL model)
item.3PL<-rbind(itemParEst(data.ref, model = "3PL", c = 0.05),
itemParEst(data.focal, model = "3PL", c = 0.05))
difRaju(irtParam = item.3PL, same.scale = FALSE)
# Saving the output into the "RAJUresults.txt" file (and default path)
r <- difRaju(verbal, group = 25, focal.name = 1, model = "1PL",
save.output = TRUE, output = c("RAJUresults","default"))
# Graphical devices
plot(r)
# Plotting results and saving it in a PDF figure
plot(r, save.plot = TRUE, save.options = c("plot", "default", "pdf"))
# Changing the path, JPEG figure
path <- "c:/Program Files/"
plot(r, save.plot = TRUE, save.options = c("plot", path, "jpeg"))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab