misfit {msd} | R Documentation |
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 |
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). |
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)
.
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 |
Author(s)
Chris Bradley (cbradley05@gmail.com)
Examples
# 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)