Partial Credit Model Fitting Function
pcmodel
is a basic fitting function for partial credit models.
pcmodel(y, weights = NULL, nullcats = c("keep", "downcode", "ignore"), start = NULL, reltol = 1e-10, deriv = c("sum", "diff"), hessian = TRUE, maxit = 100L, full = TRUE, ...)
y |
item response object that can be coerced (via |
weights |
an optional vector of weights (interpreted as case weights). |
deriv |
character. If "sum" (the default), the first derivatives of the elementary symmetric functions are calculated with the sum algorithm. Otherwise ("diff") the difference algorithm (faster but numerically unstable) is used. |
nullcats |
character string, specifying how items with null categories (i.e., categories not observed) should be treated (see details below). |
start |
an optional vector of starting values. |
hessian |
logical. Should the Hessian of the final model be computed?
If set to |
reltol, maxit, ... |
further arguments passed to |
full |
logical. Should a full model object be returned? If set to |
pcmodel
provides a basic fitting function for partial
credit models, intended as a building block for fitting partial
credit trees. It estimates the partial credit model suggested
by Masters (1982) under the cumulative threshold parameterization,
i.e., the item-category parameters η_{jk} = ∑_{\ell =
1}^{k}δ_{jk} are estimated by the the function pcmodel
.
Null categories, i.e., categories which have not been used, can be
problematic when estimating a partial credit model. Several strategies
have been suggested to cope with null categories. pcmodel
allows to select from three possible strategies via the argument
nullcats
. If nullcats
is set to "keep"
(the
default), the strategy suggested by Wilson & Masters (1993) is used to
handle null categories. That basically means that the integrity of the
response framework is maintained, i.e., no category scores are
changed. This is not the case, when nullcats
is set to
"downcode"
. Then all categories above a null category are
shifted down to close the existing gap. In both cases ("keep"
and "downcode"
) the number of estimated parameters is reduced
by the number of null categories. When nullcats
is set to
"ignore"
, these are literally ignored and a threshold parameter
is estimated during the optimization nevertheless. This strategy is
used by the related package eRm when fitting partial credit
models via eRm::PCM
.
pcmodel
returns an S3 object of class "pcmodel"
,
i.e., a list the following components:
coefficients |
a named vector of estimated item-category parameters (without the first item-category parameter which is constrained to 0), |
vcov |
covariance matrix of the parameters in the model, |
data |
modified data, used for model-fitting, i.e., cleaned for
items without variance, centralized so that the first category is
zero for all items, treated null categories as specified via
argument |
items |
logical vector of length |
categories |
list of length |
n |
number of observations (with non-zero weights), |
n_org |
original number of observations in |
weights |
the weights used (if any), |
na |
logical indicating whether the data contain NAs, |
nullcats |
either |
esf |
list of elementary symmetric functions and their derivatives for estimated parameters, |
loglik |
log-likelihood of the fitted model, |
df |
number of estimated parameters, |
code |
convergence code from |
iterations |
number of iterations used by |
reltol |
tolerance passed to |
Masters GN (1992). A Rasch Model for Partial Credit Scoring. Psychometrika, 47(2), 149–174.
Wilson M, Masters GN (1993). The Partial Credit Model and Null Categories. Psychometrika, 58(1), 87–99.
o <- options(digits = 4) ## Verbal aggression data data("VerbalAggression", package = "psychotools") ## Partial credit model for the other-to-blame situations pcm <- pcmodel(VerbalAggression$resp[, 1:12]) summary(pcm) ## visualizations plot(pcm, type = "profile") plot(pcm, type = "regions") plot(pcm, type = "piplot") plot(pcm, type = "curves") plot(pcm, type = "information") ## Get data of situation 1 ('A bus fails to ## stop for me') and induce a null category in item 2. pcd <- VerbalAggression$resp[, 1:6, drop = FALSE] pcd[pcd[, 2] == 1, 2] <- NA ## fit pcm to these data, comparing downcoding and keeping strategy pcm_va_keep <- pcmodel(pcd, nullcats = "keep") pcm_va_down <- pcmodel(pcd, nullcats = "downcode") plot(x = coef(pcm_va_keep), y = coef(pcm_va_down), xlab = "Threshold Parameters (Keeping)", ylab = "Threshold Parameters (Downcoding)", main = "Comparison of two null category strategies (I2 with null category)", pch = rep(as.character(1:6), each = 2)[-3]) abline(b = 1, a = 0) options(digits = o$digits)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.