msdprob {msd} | R Documentation |
Rating Category Probabilities
Description
Estimates the probability of observing each rating category given a set of ordered rating category thresholds.
Usage
msdprob(x, thresholds)
Arguments
x |
a real number or a vector of real numbers with no NA representing a set of person minus item measures. |
thresholds |
a numeric vector of ordered rating category thresholds with no NA. |
Details
It is assumed that thresholds
partitions the real line into length(thresholds)+1
ordered intervals that represent the rating categories.
Value
A matrix of probabilities where each of the length(thresholds)+1
rows represents a different rating category (lowest rating category is the top row) and each of the length(x)
columns represents a different person minus item measure.
Note
msdprob
can be used to create probability curves, which represent
the probability of rating an item with each rating category as a function
of the person measure minus item measure (see Examples).
Author(s)
Chris Bradley (cbradley05@gmail.com)
Examples
# Simple example
p <- msdprob(c(1.4, -2.2), thresholds = c(-1.1, -0.3, 0.5, 1.7, 2.2))
# Plot probability curves — each curve represents the probability of
# rating an item with a given rating category as a function of the
# person measure minus item measure.
x <- seq(-6, 6, 0.1)
p <- msdprob(x, thresholds = c(-3.2, -1.4, 0.5, 1.7, 3.5))
plot(0, 0, xlim = c(-6, 6), ylim = c(0, 1), type = "n",
xlab = "Person minus item measure", ylab = "Probability")
for (i in seq(1, dim(p)[1])){
lines(x, p[i,], type = "l", lwd = "2" , col = rainbow(6)[i])
}