Learn R Programming

xxIRT (version 2.0.1)

model_3pl: 3PL Model

Description

Create a 3PL model object

Usage

model_3pl(people = NULL, items = NULL, responses = NULL, theta = NULL,
  a = NULL, b = NULL, c = NULL)

Arguments

people

a data frame of theta parameters

items

a data frame of a, b, c parameters

responses

a data frame or a matrix of dichotomous responses

theta

a vector of theta parameters

a

a vector of a parmaeters

b

a vector of b parmaeters

c

a vector of c parmaeters

Details

A 3pl model contains people (peoeple parameters), items (item parameters), responses (responses data), and functions to compute P (probability), I (information), and L (likelihood). Inputs are allowed to be NULL. When necessary parameters are null, a function returns an error. All arguments in irt.model.3pl are allowed to be NULL. The people argument needs to be a one-column data frame or a data frame with a column named theta. The items argument needs to be a three-column data frame or a data frame with columns named a, b, and c. The responses argument needs to be a data frame or matrix whose dimensions match the dimension of people and items.

Examples

Run this code
# 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)
x$I(x)
x$L(x)
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
x$P(x)
x$I(x)
x$L(x)
# }

Run the code above in your browser using DataLab