首页 > 解决方案 > 试图找到一种方法将来自 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 或类似工具实现此目的?

标签: rggplot2plotlatticelikert

解决方案


您的 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

在此处输入图像描述


推荐阅读