## example: find a theta corresponding to the probability of
## correct answer using the item response function of 2PLM
## (a = 1, b = 0.2)
# set a function of theta
find.th <- function(theta, p) {
p - drm(theta = theta, a = 1, b = 0.2, D = 1)
}
# find the theta corresponding to p = 0.2
bisection(.fun = find.th, p = 0.2, lb = -10, ub = 10)$root
# find the theta corresponding to p = 0.8
bisection(.fun = find.th, p = 0.8, lb = -10, ub = 10)$root
Run the code above in your browser using DataLab