r - 试图找到一种方法将来自 R 中 3 个不同 mirt 模型的 IRT 信息图组合在一起
问题描述
我希望将所有三个“测试信息功能”行(每个模型一个)组合成一个相同的图表。我有一个 1-5 类李克特响应的数据集,有 400 行,每列 8 列(每个项目一个)。我使用 R 中的 mirt 包在这些集合上运行了三个 IRT 模型,并生成了测试信息图。我想将来自三个不同(分级响应)模型、三行的 IRT 测试信息图组合在同一个网格中。
plot(PFgrmodel29, type = 'info', xlim = c(-4, 4), ylim=c(0,85))
plot(PFgrmodel43, type = 'info', xlim = c(-4, 4), ylim=c(0,85))
plot(PFgrmodel57, type = 'info', xlim = c(-4, 4), ylim=c(0,85))
测试信息图示例:
如何使用 mirt、lattice、ggplot2 或类似工具实现此目的?
解决方案
您的 mirt 包中的图是一个格子对象,因此您可以尝试使用 latticeExtra,因为您没有提供数据集,所以我在下面使用包中的示例数据集提供了示例代码:
library(mirt)
library(latticeExtra)
fulldata <- expand.table(LSAT7)
mod1 <- mirt(fulldata,1,SE=TRUE)
mod2 <- mirt(fulldata,1, itemtype = 'Rasch')
mod3 <- mirt(fulldata,1,itemtype='ideal')
key=list(columns=2,
text=list(lab=c("mod1","mod2","mod3")),
lines=list(lwd=4, col=c("blue","orange","red"))
)
p1 = plot(mod1,type="info",key=key)
p2 = update(plot(mod2,type="info"),col="orange")
p3 = update(plot(mod3,type="info"),col="red")
p1+p2+p3
推荐阅读
- java - Spring Boot Cucumber 测试无法解析占位符“random.uuid”
- javascript - 如何在 JavaScript/ReactJs 中检索图像的所有细节和属性?
- google-colaboratory - 可以在欧洲使用 Colab Pro 吗?
- python - 使用文本文件中的信息对列表进行排序
- python - 为什么这些整数被转换为随机字符?
- mysql - 由于未知原因无法执行查询字符串
- python - 如何将 keras categorical_accuracy 与多维输出一起使用?
- ios - UITABLEVIEWCELL 的扩展无法快速运行
- reactjs - 如何在不使用“react-router-dom”进行 SSR 时检测 404 路由(NoMatch)
? - java - TicTacToe 极小极大算法与 Java