所以我有一些数据适合 IRT 分级响应模型,使用以下代码:
hdat <- read.csv("data.csv", header=TRUE)
library("mirt")
model.grm <- 'height = 1-9'
results.grm <- mirt(data=hdat, model=model.grm, itemtype="graded", SE=TRUE, verbose=FALSE)
coef.grm <- coef(results.grm, IRTpars=TRUE, simplify=TRUE)
items.grm <- as.data.frame(coef.grm$items)
print(items.grm)
png(filename="plot.png")
plot(results.grm, type = 'trace', which.items = c(1),
main = "", par.settings = simpleTheme(lty=1:4,lwd=2),
auto.key=list(points=FALSE,lines=TRUE, columns=4))
dev.off()
我得到这个图:
我如何找出 p2 在 theta = -1 处的值?
我认为绘制的对象results.grm@ParObjects$pars[[1]]
具有以下内容:
Formal class 'graded' [package "mirt"] with 23 slots
..@ par : num [1:5] 4.888 2.815 0.561 -1.728 -5.509
..@ SEpar : num [1:5] 0.0421 0.0311 0.0252 0.0279 0.0472
..@ parnames : chr [1:5] "a1" "d1" "d2" "d3" ...
..@ est : Named logi [1:5] TRUE TRUE TRUE TRUE TRUE
.. ..- attr(*, "names")= chr [1:5] "a1" "d1" "d2" "d3" ...
..@ dps :function ()
..@ dps2 :function ()
..@ constr : logi(0)
..@ itemclass : int 2
..@ parnum : Named int [1:5] 1 2 3 4 5
.. ..- attr(*, "names")= chr [1:5] "a1" "d1" "d2" "d3" ...
..@ nfact : int 1
..@ nfixedeffects: num 0
..@ fixed.design : num [1, 1] 0
..@ dat : num [1, 1] 0
..@ ncat : int 5
..@ gradient : num(0)
..@ hessian : num [1:5, 1:5] -4814 1846 362 -1200 -2266 ...
..@ itemtrace : num[0 , 0 ]
..@ lbound : num [1:5] -Inf -Inf -Inf -Inf -Inf
..@ ubound : num [1:5] Inf Inf Inf Inf Inf
..@ any.prior : logi FALSE
..@ prior.type : int [1:5] 0 0 0 0 0
..@ prior_1 : num [1:5] NaN NaN NaN NaN NaN
..@ prior_2 : num [1:5] NaN NaN NaN NaN NaN
probtrace(extract.item(results.grm, 1), c(-1)) 应该可以工作 - 此外,查看https://github.com/philchalmers/mirt/issues/21可能会有所帮助
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句