Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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, ...)

## S3 method for class 'gdina'
predict(object, group=1, ...)

## S3 method for class 'mcdina'
predict(object, group=1, ...)

## S3 method for class 'gdm'
predict(object, group=1, ...)

## S3 method for class 'slca'
predict(object, group=1, ...)

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, gdina, mcdina, slca or gdm.

dat

Dataset with item responses

group

Group index for use

...

Further arguments to be passed.

Value

A list with following entries

expected

Array with expected values (persons \times classes \times items)

probs.categ

Array with expected probabilities for each category (persons \times categories \times classes \times items)

variance

Array with variance in predicted values for each person and each item.

residuals

Array with residuals for each person and each item

stand.resid

Array with standardized residuals for each person and each item

Examples

## Not run: 
#############################################################################
# EXAMPLE 1: Fitted Rasch model in TAM package
#############################################################################

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

## End(Not run)

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

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

CDM

Cognitive Diagnosis Modeling

v7.5-15
GPL (>= 2)
Authors
Alexander Robitzsch [aut, cre], Thomas Kiefer [aut], Ann Cathrice George [aut], Ali Uenlue [aut]
Initial release
2020-03-10 14:19:21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.