Learn R Programming

psychotools (version 0.2-0)

RaschModel.fit: Rasch Model Fitting Function

Description

RaschModel.fit is a basic fitting function for simple Rasch models.

Usage

RaschModel.fit(y, weights = NULL, start = NULL, reltol = 1e-10,
  deriv = c("sum", "diff", "numeric"), hessian = TRUE,
  maxit = 100L, full = TRUE, gradtol = reltol, iterlim = maxit, ...)

Arguments

y
object that can be coerced (via as.matrix) to a binary 0/1 matrix.
weights
an optional vector of weights, interpreted as case weights (integer only).
start
an optional vector of starting values.
deriv
character. Which type of derivatives should be used for computing gradient and Hessian matrix? Analytical with sum algorithm ("sum"), analytical with difference algorithm ("diff", faster but numerically unstable), or
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.
gradtol, iterlim
numeric. For backward compatibility with previous versions these arguments are mapped to reltol and maxit, respectively.

Value

  • RaschModel.fit returns an S3 object of class "RaschModel", i.e., a list with components as follows.
  • coefficientsestimated item difficulty parameters (without first item parameter which is always constrained to be 0),
  • vcovcovariance matrix of the parameters in the model,
  • logliklog-likelihood of the fitted model,
  • dfnumber of estimated parameters,
  • datathe original data supplied (excluding columns without variance),
  • weightsthe weights used (if any),
  • nnumber of observations (with non-zero weights),
  • itemsstatus indicator (0, 0/1, 1) of all original items,
  • nalogical indicating whether the data contains NAs,
  • elementary_symmetric_functionsList of elementary symmetric functions for estimated parameters (up to order 2; or 1 in case of numeric derivatives),
  • codeconvergence code from optim,
  • iterationsnumber of iterations used by optim,
  • reltoltolerance passed to optim,
  • derivtype of derivatives used for computing gradient and Hessian matrix.

Details

RaschModel.fit provides a basic fitting function for simple Rasch models, intended as a building block for fitting Rasch trees and Rasch mixtures in the psychotree package, respectively. RaschModel.fit returns an object of class "RaschModel" for which several basic methods are available, including print, plot, summary, coef, vcov, logLik, and worth.

See Also

PCModel.fit, RSModel.fit, btReg.fit

Examples

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

## Rasch model for the other-to-blame situations
m <- RaschModel.fit(VerbalAggression$resp2[, 1:12])
summary(m)
plot(m)

Run the code above in your browser using DataLab