Learn R Programming

CDM (version 4.8-0)

predict: Expected Values and Predicted Probabilities from Item Response Response Models

Description

This function computes expected values for each person and each item based on the individual posterior distribution. The output of this function can be the basis of creating item and person fit statistics.

Usage

IRT.predict(object, dat, group=1)

## S3 method for class 'din':
predict(object, group=1, \dots)

## S3 method for class 'gdina':
predict(object, group=1, \dots)

## S3 method for class 'mcdina':
predict(object, group=1, \dots)

## S3 method for class 'gdm':
predict(object, group=1, \dots)

## S3 method for class 'slca':
predict(object, group=1, \dots)

Arguments

object
Object for the S3 methods IRT.irfprob and IRT.posterior are defined. In the CDM packages, these are the objects of class din
dat
Dataset with item responses
group
Group index for use
...
Further arguments to be passed.

Value

  • A list with following entries
  • expectedArray with expected values (persons $\times$ classes $\times$ items)
  • probs.categArray with expected probabilities for each category (persons $\times$ categories $\times$ classes $\times$ items)
  • varianceArray with variance in predicted values for each person and each item.
  • residualsArray with residuals for each person and each item
  • stand.residArray with standardized residuals for each person and each item

Examples

Run this code
#############################################################################
# EXAMPLE 1: Fitted Rasch model in TAM package
#############################################################################

library(TAM)
data(sim.rasch, package="TAM")

#--- Model 1: Rasch model
mod1 <- tam.mml(resp=sim.rasch) 
# apply IRT.predict function
prmod1 <- IRT.predict(mod1 , mod1$resp )
str(prmod1)

#############################################################################
# EXAMPLE 2: Predict function for din
#############################################################################

data(sim.dina)
data(sim.qmatrix)

# DINA Model
mod1 <- din(sim.dina, q.matr = sim.qmatrix, rule = "DINA" )
summary(mod1)
# apply predict method
prmod1 <- IRT.predict( mod1 , sim.dina )
str(prmod1)

Run the code above in your browser using DataLab