楼主: jiandong4388
3710 13

[程序分享] 【独家发布】IRT-项目反应理论学习分享之-three parameter model(3PL)专栏(一) [推广有奖]

贵宾

一无所有的小博

学科带头人

79%

还不是VIP/贵宾

-

TA的文库  其他...

数据文库

IRT

meta-analysis

威望
1
论坛币
220577 个
通用积分
8540.5109
学术水平
361 点
热心指数
464 点
信用等级
300 点
经验
72064 点
帖子
2257
精华
2
在线时间
1681 小时
注册时间
2013-7-7
最后登录
2024-3-19

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
与上一节类似,这几次专栏分别上传回家修整几天的学习的一些实践代码。特此分享,供大家学习:
#loading package
library(ltm)

# the three parameter model
tpm1 <- tpm(LSAT)

# use 'nlminb' as optimizer
tpm2 <- tpm(LSAT, control = list(optimizer = "nlminb"))


# the three parameter model with equal
# discrimination parameter across items
# fix the guessing parameter for the third item to zero
tpm3 <- tpm(LSAT, type = "rasch", constraint = cbind(3, 1, 0))


## Factor Scores for the two-parameter logistic model
factor.scores(tpm1)

#coef
coef(tpm1)

#fitted
fitted(tpm1)

#annova
annova(tpm1,tpm2)

#vcov
vcov(tpm1)
sqrt(diag(vcov(tpm1))) # standard errors under additive parameterization

#item-fit statistics for the three parameter model
item.fit(tpm1)

#person-fit statistics for the three parameter model
person.fit(tpm1)

#margins
margins(tpm1)
margins(tpm1, "three")

#factor score
factor.scores(tpm1)

#summary
summary(tpm1)

#Computes the residuals for vectors of response patterns
residuals(tpm1)
residuals(tpm1, order = FALSE)

# Cronbach's alpha for the LSAT data-set
# with a Bootstrap 95% CI
cronbach.alpha(LSAT, CI = TRUE)   #without bootsrap
cronbach.alpha(LSAT, CI = TRUE, B = 500)

#plot tpm

## Compare the Item Characteristic Curves for the LSAT data,
## under the constraint Rasch model, the unconstraint Rasch model,
## and the three parameter model assuming equal discrimination
## across items
par(mfrow = c(2, 2))
pl1 <- plot(rasch(LSAT, constr = cbind(length(LSAT) + 1, 1)))
text(2, 0.35, "Rasch model\nDiscrimination = 1")
pl2 <- plot(rasch(LSAT))
text(2, 0.35, "Rasch model")
pl3 <- plot(tpm(LSAT, type = "rasch", max.guessing = 1))
text(2, 0.35, "Rasch model\nwith Guessing parameter")

## Compare the Item Characteristic Curves for Item 4
## (you have to run the above first)
plot(range(pl1[, "z"]), c(0, 1), type = "n", xlab = "Ability",
     ylab = "Probability", main = "Item Characteristic Curves - Item 4")
lines(pl1[, c("z", "Item 4")], lwd = 2, col = "black")
lines(pl2[, c("z", "Item 4")], lwd = 2, col = "red")
lines(pl3[, c("z", "Item 4")], lwd = 2, col = "blue")
legend("right", c("Rasch model Discrimination = 1", "Rasch model",
       "Rasch model with\nGuessing parameter"), lwd = 2, col = c("black",
       "red", "blue"), bty = "n")



大家在实际运行中只要把数据替换为自己的格式,并在之后的代码做相应的调整即可。
附件是我已经写好并可以运行的代码,有R格式的源文件也有txt文件。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Parameter paramete 项目反应理论 Meter Three 项目

three parameter model-3PL.zip

2.04 KB

需要: 1 个论坛币  [购买]

3PL

本附件包括:

  • tpm-three parameter model.R
  • 3PL.txt

已有 2 人评分经验 学术水平 热心指数 信用等级 收起 理由
晓七 + 100 + 1 + 1 + 1 精彩帖子
Jealy + 100 + 1 + 1 + 1 奖励积极上传好的资料

总评分: 经验 + 200  学术水平 + 2  热心指数 + 2  信用等级 + 2   查看全部评分

本帖被以下文库推荐

  • · IRT|主题: 107, 订阅: 74
喜欢经济学,行为学,投资学,行为学,心理学,and 编程
沙发
Jealy 在职认证  发表于 2016-7-17 21:55:50 |只看作者 |坛友微信交流群

回帖奖励 +1

感谢分享哟!

使用道具

藤椅
晓七 在职认证  发表于 2016-7-17 22:41:34 |只看作者 |坛友微信交流群
虽然看不懂,但是看起来很高端的样子。加油!

使用道具

板凳
beijin2008 发表于 2016-7-17 22:47:11 |只看作者 |坛友微信交流群
确实不容易,赞

使用道具

报纸
zishengzheqiang 发表于 2016-7-18 10:02:17 |只看作者 |坛友微信交流群
好专业的样子,支持一下

使用道具

地板
jiandong4388 学生认证  发表于 2016-7-18 11:43:54 来自手机 |只看作者 |坛友微信交流群
zishengzheqiang 发表于 2016-7-18 10:02
好专业的样子,支持一下
自己琢磨,可能还有一点欠缺

使用道具

7
jiandong4388 学生认证  发表于 2016-7-18 11:44:12 来自手机 |只看作者 |坛友微信交流群
晓七 发表于 2016-7-17 22:41
虽然看不懂,但是看起来很高端的样子。加油!
自己琢磨,还有点欠缺

使用道具

8
jiandong4388 学生认证  发表于 2016-7-18 11:44:27 来自手机 |只看作者 |坛友微信交流群
beijin2008 发表于 2016-7-17 22:47
确实不容易,赞
谢谢支持。多多指教

使用道具

9
jiandong4388 学生认证  发表于 2016-7-18 11:44:35 来自手机 |只看作者 |坛友微信交流群
Jealy 发表于 2016-7-17 21:55
感谢分享哟!
谢谢支持

使用道具

10
xiexie1111 发表于 2016-7-20 23:49:53 |只看作者 |坛友微信交流群
downloaded to learn, thanks for your sharing, xie xie

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-25 15:57