Learn R Programming

msd (version 0.3.1)

misfit: Infit and Outfit Statistics

Description

Calculates infit and outfit statistics for items and persons.

Usage

misfit(data, items, persons, thresholds, minRating = NULL)

Arguments

data

a numeric matrix of ordinal rating scale data whose entries are integers with missing data set to NA. Rows are persons and columns are items. The ordinal rating scale is assumed to go from the smallest to largest integer in integer steps unless minRating is specified.

items

a numeric vector of item measures with missing values set to NA.

persons

a numeric vector of person measures with missing values set to NA.

thresholds

a numeric vector of ordered rating category thresholds with no NA.

minRating

integer representing the smallest ordinal rating category. Default is NULL (see Details).

Value

A list whose elements are:

infit_items

a vector of infit statistics for the items

outfit_items

a vector of outfit statistics for the items

infit_persons

a vector of infit statistics for the persons

outfit_persons

a vector of outfit statistics for the persons

Details

minRating must be specified if either the smallest or largest possible rating category is not in data (no person used one of the extreme rating categories). If minRating is specified, the ordinal rating scale is assumed to go from minRating to minRating + length(thresholds).

Examples

Run this code
# NOT RUN {
# Using randomly generated values
d <- as.numeric(sample(0:5, 500, replace = TRUE))
dm <- matrix(d, nrow = 50, ncol = 10)
im <- runif(10, -2, 2)
pm <- runif(50, -2, 2)
th <- sort(runif(5, -2, 2))
m <- misfit(data = dm, items = im, persons = pm, thresholds = th)

# If the lowest or highest rating category is not in \code{data}, specify \code{minRating}
dm[dm == 0] <- NA
m2 <- misfit(data = dm, items = im, persons = pm, thresholds = th, minRating = 0)
# }

Run the code above in your browser using DataLab