## Example: Find the theta value corresponding to a given probability
## of a correct response using the item response function of a 2PLM
## (a = 1, b = 0.2)
# Define a function of theta
find.th <- function(theta, p) {
p - drm(theta = theta, a = 1, b = 0.2, D = 1)
}
# Find the theta value corresponding to p = 0.2
bisection(.fun = find.th, p = 0.2, lb = -10, ub = 10)$root
# Find the theta value 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