Learn R Programming

xxIRT (version 2.0.1)

irt_model: Create IRT Models

Description

Create a IRT model object via a common interface

Usage

irt_model(model = c("3pl"), people = NULL, items = NULL,
  responses = NULL, ...)

# S3 method for irt.model print(x, ...)

# S3 method for model.3pl plot(x, ...)

Arguments

model

the name of IRT model

people

a data frame of people parameters

items

a data frame of item parameters

responses

a data frame of responses

...

other arguments passed to the constructor

x

a irt_model object

Details

In plot_irt_model, use the stats argument to control what IRT statistics to draw. Use total argument to control whether aggregate results over items/people or not.

Examples

Run this code
# NOT RUN {
# create a 3PL model with given parameters
x <- model_3pl()$gendata(10, 5)
irt_model("3pl", x$people, x$items, x$responses)
# create a 3PL model with generated data
irt_model("3pl")$gendata(10, 5)
# generate data with Rasch items
irt_model("3pl")$gendata(10, 5, a.sd=0, c.alpha=0)
# draw test/item characteristic curve
x <- irt_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