predict.pcmodel: Predict Methods for Item Response Models

predict.pcmodelR Documentation

Predict Methods for Item Response Models

Description

Prediction of (cumulated) response probabilities and responses based on fitted item response models.

Usage

## S3 method for class 'pcmodel'
predict(object, newdata = NULL, type = c("probability",
  "cumprobability", "mode", "median", "mean", "category-information",
  "item-information", "test-information"), ref = NULL, ...)

Arguments

object

a fitted model object whose item parameters should be used for prediction.

newdata

an optional (possibly named) vector of person parameters used for prediction. If NULL (the default), the person parameters of the subjects used to fit the model in object are used.

type

character of length one which determines the type of prediction (see details below).

ref

arguments passed over to internal calls of itempar or threshpar. Not used for models estimated via MML.

...

further arguments which are currently not used.

Details

Depending on the value of type either probabilities, responses or some form of information under the model specified in object are returned:

If type is "probability", the category response probabilities are returned.

If type is "cumprobability", the cumulated category response probabilities are returned, i.e., P(X_{ij} \geq k) with k corresponding to the categories of item j.

If type is "mode", the most probable category response for a given subject and item is returned.

If type is "median", the first category k where P(X_{ij} = k) \geq 0.5 is returned.

If type is "mean", the rounded expected category response, i.e., E(X_{ij}|\theta_{i}), is returned.

If type is "category-information", the item-category information as suggested by Bock (1972) is returned.

If type is "item-information", the item information as suggested by Samejima (1974) is returned.

If type is "test-information", the sum over the individual item information values is returned.

Value

A (possibly named) numeric matrix with rows corresponding to subjects and columns corresponding to the whole test, the single items or categories. The exact content depends on the value of type (see details above).

References

Bock RD (1972). Estimating Item Parameters and Latent Ability When Responses Are Scored in Two or More Nominal Categories. Psychometrika, 37(1), 29–51.

Samejima F (1974). Normal Ogive Model on the Continuous Response Level in the Multidimensional Latent Space. Psychometrika, 39(1), 111–121.

See Also

The help page of the generic function predict and other predict methods (e.g., predict.lm, predict.glm, ...)

Examples

o <- options(digits = 4)

## load verbal aggression data
data("VerbalAggression", package = "psychotools")

## fit a partial credit model to first ten items
pcmod <- pcmodel(VerbalAggression$resp[, 1:10])

## predicted response probabilities for each subject and category (the default)
head(predict(pcmod), 3)

## predicted mode (most probable category) for certain subjects whose person
## parameters are given via argument "newdata"
predict(pcmod, type = "mode",
  newdata = c("Sarah" = 1.2, "Michael" = 0.1, "Arnd" = -0.8))

## rounded expected category value for the same subjects
predict(pcmod, type = "mean",
  newdata = c("Sarah" = 1.2, "Michael" = 0.1, "Arnd" = -0.8))

## in the Rasch model mode, mean and median are the same
raschmod <- raschmodel(VerbalAggression$resp2[, 1:10])
med <- predict(raschmod, type = "median")
mn <- predict(raschmod, type = "mean")
mod <- predict(raschmod, type = "mode")

head(med, 3)

all.equal(med, mn)
all.equal(mod, mn)

options(digits = o$digits)

psychotools documentation built on May 29, 2024, 8:12 a.m.