Learn R Programming

xxIRT (version 2.0.1)

estimate_people: Estimate People Parameters

Description

Estimate people parameters when item parameters are known

estimate_people_3pl_mle is the maximum likelihood (ML) estimator of the people parameter.

estimate_people_3pl_map is the maximum a posteriori (MAP) estimator of people parameters

estimate_people_3pl_eap is the expected a priori (EAP) estimator of people parameters

Usage

estimate_people(responses, items, model = c("3pl"), method = c("mle", "eap",
  "map"), ...)

estimate_people_3pl_mle(responses, items, init = 0, iter = 30, conv = 0.01, bound = 3.5, debug = FALSE)

estimate_people_3pl_map(responses, items, prior.mean = 0, prior.sd = 1, init = 0, iter = 30, conv = 0.01, bound = 3.5, debug = FALSE)

estimate_people_3pl_eap(responses, items)

Arguments

responses

a data frame or matrix of responses

items

a data frame of item parameters

model

the IRT model

method

the estimation method

...

further arguments

init

initial values of people parameters, a number or a vector

iter

the maximum of Newton-Raphson iterations

conv

convergence criterion

bound

the bounds of estimated people parameters

debug

TRUE to turn on debugging mode

prior.mean

the mean of the prior distribuiton

prior.sd

the standard deviation of the prior distribution

Value

a data frame of estimated people parameters

Details

The debug mode draws a convergence curve. For the maximum likelihood (ML) estimation, refer to Baker and Kim (2004), pp. 66-69.

For the maximum a posteriori (MAP) estimation, refer to Baker and Kim (2004), pp. 192.

For the expected a priori (EAP), refer to Baker and Kim (2004), pp. 193.

Examples

Run this code
# NOT RUN {
# data generation
library(ggplot2)
library(reshape2)
library(dplyr)
data <- irt_model("3pl")$gendata(500, 50)

# Estimate people parameters: MLE
x.mle <- estimate_people(data$responses, data$items, "3pl", "mle")
# Estimate people parameters: MAP
x.map <- estimate_people(data$responses, data$items, "3pl", "map")
# Estimate people parameters: EAP
x.eap <- estimate_people(data$responses, data$items, "3pl", "eap")
# Comparison with true parameters
x <- data.frame(true=data$people$theta, mle=x.mle$people$theta, 
  map=x.map$people$theta, eap=x.eap$people$theta)
round(t(apply(x, 2, function(v) c(R=cor(v, x$true), RMSE=rmse(v, x$true)))), 2)
melt(x, id.vars="true") %>% 
  ggplot(aes(x=true, y=value, color=variable)) + geom_point(pch=1) +
  facet_wrap(~variable, nrow=2) + xlab("True") + ylab("Est.") +
  theme_bw() + theme(legend.key=element_blank())
# }

Run the code above in your browser using DataLab