"R 1모수 모형"의 두 판 사이의 차이

10번째 줄: 10번째 줄:
model <- rasch(df)
model <- rasch(df)


cat('로그우도:', model$log.Lik)
cat('로그우도:', model$log.Lik, "\n")
cat('AIC:', summary(model)$AIC)
cat('AIC:', summary(model)$AIC, "\n")
cat('BIC:', summary(model)$BIC)
cat('BIC:', summary(model)$BIC, "\n")
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang='r' notebook=ltm>
<syntaxhighlight lang='r' notebook=ltm>

2021년 10월 3일 (일) 18:22 판

1 개요

R IRT 1모수 모형
R 문항반응이론 1PLM
R 문항반응이론 1모수 모형

2 ltm 패키지

df <- read.csv("https://github.com/jmnote/zdata/raw/master/github.com/cran/ltm/data/LSAT.csv")
library(ltm)
model <- rasch(df)

cat('로그우도:', model$log.Lik, "\n")
cat('AIC:', summary(model)$AIC, "\n")
cat('BIC:', summary(model)$BIC, "\n")
# 계수
coef(model)
# 문항특성곡선
plot(model)
# 문항정보곡선
plot(model, "IIC")

3 irtplay 패키지

df <- read.csv("https://github.com/jmnote/zdata/raw/master/github.com/cran/ltm/data/LSAT.csv")
library(irtplay)
model <- est_irt(data=df, model="1PLM", verbose=FALSE)
coef(model)
plotICC <- function(model) {
  p1 <- model$estimates$par.1
  p2 <- model$estimates$par.2
  p3 <- model$estimates$par.3
  p3[is.na(p3)] <- 0
  D <- model$scale.D
  z <- seq(-4, 4, length=100)
  len <- nrow(model$estimates)
  pos <- round(seq(10, 90, length=len))
  for( i in 1:len ) {
    f <- function(x) {p3[i]+(1-p3[i])*plogis(p1[i]*D*(x-p2[i]))}
    if( i == 1 ) plot(z, f(z), type='l', col=i, ylim=c(0,1),
                      main="Item Characteristic Curves",
                      xlab="Ability", ylab="Probability")
    else lines(z, f(z), type='l', col=i, ylim=c(0,1))
    text(z[pos[i]], f(z[pos[i]]), adj=c(0,2), labels=c(paste('Item',i)), col=i)
  }
}
plotICC(model)

4 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}