# NOT RUN {
# create a 3pl model using given parameters
theta <- c(-1, 0, 1)
a <- c(.5882, 1)
b <- c(-1, 1)
c <- c(0, .2)
u <- matrix(c(1, 0, 1, 0, 1, 0), nrow=3)
people <- data.frame(theta=theta)
items <- data.frame(a=a, b=b, c=c)
model_3pl(people=people, items=items, responses=u)
model_3pl(people=people, items=items)
model_3pl(theta=theta, a=a, b=b, c=c)
model_3pl(people=people, a=a, b=b, c=c)
model_3pl(theta=theta, items=items)
# compute P(robability), I(nformation), L(ikelihood)
x <- model_3pl(people=people, items=items, responses=u)
x$P()
x$I()
x$L()
model_3pl()$P(x)
model_3pl()$I(x)
model_3pl()$L(x)
# create a 3pl model using generated data
x <- model_3pl()$gendata(10, 5)
x$P(x)
x$I(x)
x$L(x)
# draw test/item characteristic curve
x <- model_3pl()$gendata(20, 5)
plot(x, stats="prob")
plot(x, stats="prob", total=FALSE)
# draw test/iten information function
plot(x, stats="info")
plot(x, stats="info", total=FALSE)
# draw loglikelihood
plot(x, stats="loglik")
plot(x, stats="loglik", total=FALSE, theta=seq(-5, 5, .1))
# }
Run the code above in your browser using DataLab