R: Latent Trait Posterior of the Rating Scale Model
fmodelrsm
R Documentation
Latent Trait Posterior of the Rating Scale Model
Description
fmodelpcm evaluates the (unnormalized) posterior density of the latent trait of a rating scale item response model with a given prior distribution, and computes the probability for each item and response category given the latent trait.
Usage
fmodelrsm(zeta, y, cpar, dpar, prior = dnorm, ...)
Arguments
zeta
Latent trait value.
y
Vector of length m for a single response pattern, or matrix of size s by m of a set of s item response patterns. In the latter case the posterior is computed by conditioning on the event that the response pattern is one of the s response patterns. Elements of y should be integers from 0 to r-1 where r is the number of response categories.
cpar
Vector of length r-1 of category "threshold" parameters.
dpar
Vector of length m of item "difficulty" parameters.
prior
Function that evaluates the prior distribution of the latent trait. The default is the standard normal distribution.
...
Additional arguments to be passed to prior.
Details
The rating scale model is parameterized here as a special case of the partial credit model where
for y = 0, 1,…, r-1 where β_{jk} = δ_j + γ_k and γ_0 = 0. The parameters δ_j and γ_k are the 'difficulty' (dpar) and 'threshold' (cpar) parameters, respectively. This model was proposed by Andersen (1977) and Andrich (1978a, 1978b).
Value
post
The log of the unnormalized posterior distribution evaluated at zeta.
prob
Matrix of size m by 2 array of item response probabilities.
Note
The number of response categories (r) is inferred from the number of columns in dpar, not from the maximum value in y.
Because the rating scale model can be viewed as a special case of the partial credit model, the latter can be used with fmodelpcm to specify more general models.
Author(s)
Timothy R. Johnson
References
Andersen, E. B. (1977). Sufficient statistics and latent trait models. Psychometrika, 42, 69-81.
Andrich, D. (1978a). A rating formulation for ordered response categories. Psychometrika, 43, 561-573.
Andrich, D. (1978b). Application of a psychometric rating scale model to ordered categories which are scored with successive integers. Applied Psychological Measurement, 2, 581-594.
Examples
samp <- 5000 # samples from posterior distribution
burn <- 1000 # burn-in samples to discard
gamm <- c(0, 0)
delt <- rep(0, 5)
post <- postsamp(fmodelrsm, c(0,1,2,1,0), cpar = gamm, dpar = delt,
control = list(nbatch = samp + burn))
post <- data.frame(sample = 1:samp,
zeta = post$batch[(burn + 1):(samp + burn)])
with(post, plot(sample, zeta), type = "l") # trace plot of sampled realizations
with(post, plot(density(zeta, adjust = 2))) # density estimate of posterior distribution
with(posttrace(fmodelrsm, c(0,1,2,1,0), cpar = gamm, dpar = delt),
plot(zeta, post, type = "l")) # profile of log-posterior density
information(fmodelrsm, c(0,1,2,1,0), cpar = gamm, dpar = delt) # Fisher information
with(post, mean(zeta)) # posterior mean
postmode(fmodelrsm, c(0,1,2,1,0), cpar = gamm, dpar = delt) # posterior mode
with(post, quantile(zeta, probs = c(0.025, 0.975))) # posterior credibility interval
profileci(fmodelrsm, c(0,1,2,1,0),
cpar = gamm, dpar = delt) # profile likelihood confidence interval