psychotools (version 0.5-1)

rsmodel: Rating Scale Model Fitting Function

Description

rsmodel is a basic fitting function for rating scale models.

Usage

rsmodel(y, weights = NULL, start = NULL, reltol = 1e-10,
  deriv = c("sum", "diff"), hessian = TRUE,
  maxit = 100L, full = TRUE, …)

Arguments

y

item response object that can be coerced (via as.matrix) to a numeric matrix with scores 0, 1, … Typically, either already a matrix, data frame, or dedicated object of class itemresp.

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.

start

an optional vector of starting values.

hessian

logical. Should the Hessian of the final model be computed? If set to FALSE, the vcov method can only return NAs and consequently no standard errors or tests are available in the summary.

reltol, maxit, …

further arguments passed to optim.

full

logical. Should a full model object be returned? If set to FALSE, no variance-covariance matrix and no matrix of estimating functions are computed.

Value

rsmodel returns an S3 object of class "rsmodel", i.e., a list with the following components:

coefficients

a named vector of estimated item-specific parameters (without the first item parameter which is constrained to 0) and estimated cumulative relative treshold parameters (again without first threshold parameter which is also 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 and without observations with zero weight. Be careful, this is different than for objects of class "raschmodel" or "btmodel", where data contains the original data,

items

logical vector of length ncol(y), which indicates which items have variance (TRUE), i.e., are identified and have been used for the estimation or not (FALSE),

categories

integer vector of length ncol(y), which contains the number of categories minus one per item,

n

number of observations (with non-zero weights),

n_org

original number of observations in y,

weights

the weights used (if any),

na

logical indicating whether the data contains NAs,

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 optim,

iterations

number of iterations used by optim,

reltol

tolerance passed to optim.

Details

rsmodel provides a basic fitting function for rating scales models, intended as a building block for fitting rating scale trees. It estimates the rating scale model in the parametrization suggested by Andrich (1978), i.e., item-specific parameters \(\xi_{j}\) who mark the location of the first absolute threshold of an item on the theta axis and cumulative relative threshold parameters \(\kappa_{k}\) are estimated by the function rsmodel.

rsmodel returns an object of class "rsmodel" (and class "pcmodel") for which several basic methods are available, including print, plot, summary, coef, vcov, logLik, discrpar, estfun, itempar, threshpar, and personpar.

References

Andrich D (1978). Application of a Psychometric Rating Model to Ordered Categories Which Are Scored with Successive Integers. Psychometrika, 2(4), 581--594.

See Also

pcmodel, gpcmodel, raschmodel, plmodel, btmodel

Examples

Run this code
# NOT RUN {
o <- options(digits = 4)

## Verbal aggression data
data("VerbalAggression", package = "psychotools")

## Rating scale model for the other-to-blame situations
rsm <- rsmodel(VerbalAggression$resp[, 1:12])
summary(rsm)

## visualizations
plot(rsm, type = "profile")
plot(rsm, type = "regions")
plot(rsm, type = "curves")
plot(rsm, type = "information")
plot(rsm, type = "piplot")

options(digits = o$digits)
# }

Run the code above in your browser using DataCamp Workspace