Skip to main content

Rasch Model Fitting Function

Description

raschmodel is a basic fitting function for simple Rasch models.

Usage

raschmodel(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 item response object that can be coerced (via as.matrix) to a binary 0/1 matrix (e.g., from class itemresp.
weights an optional vector of weights (interpreted as case weights).
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 numerical.
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.

Details

raschmodel provides a basic fitting function for simple Rasch models, intended as a building block for fitting Rasch trees and Rasch mixtures in the psychotree and psychomix packages, respectively.

raschmodel returns an object of class “raschmodel” for which several basic methods are available, including print, plot, summary, coef, vcov, logLik, estfun, discrpar, itempar, threshpar, and personpar.

Value

raschmodel returns an S3 object of class “raschmodel”, i.e., a list with the following components:

coefficients estimated item difficulty parameters (without first item parameter which is always constrained to be 0),
vcov covariance matrix of the parameters in the model,
loglik log-likelihood of the fitted model,
df number of estimated parameters,
data the original data supplied (excluding columns without variance),
weights the weights used (if any),
n number of observations (with non-zero weights),
items status indicator (0, 0/1, 1) of all original items,
na logical indicating whether the data contains NAs,
elementary_symmetric_functions List of elementary symmetric functions for estimated parameters (up to order 2; or 1 in case of numeric derivatives),
code convergence code from optim,
iterations number of iterations used by optim,
reltol tolerance passed to optim,
deriv type of derivatives used for computing gradient and Hessian matrix,
call original function call.

See Also

nplmodel, pcmodel, rsmodel, gpcmodel, btmodel

Examples

library("psychotools")

o <- options(digits = 4)

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

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

Rasch model

Difficulty parameters:
             Estimate Std. Error z value Pr(>|z|)    
S1DoCurse   -1.56e-08   2.04e-01    0.00  1.00000    
S1WantScold  6.86e-01   2.00e-01    3.44  0.00059 ***
S1DoScold    8.73e-01   1.99e-01    4.38  1.2e-05 ***
S1WantShout  1.21e+00   2.00e-01    6.03  1.6e-09 ***
S1DoShout    2.29e+00   2.13e-01   10.77  < 2e-16 ***
S2WantCurse -5.39e-01   2.13e-01   -2.53  0.01152 *  
S2DoCurse    3.61e-01   2.01e-01    1.80  0.07200 .  
S2WantScold  5.34e-01   2.00e-01    2.67  0.00753 ** 
S2DoScold    1.36e+00   2.01e-01    6.76  1.4e-11 ***
S2WantShout  1.28e+00   2.01e-01    6.39  1.6e-10 ***
S2DoShout    3.07e+00   2.34e-01   13.09  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Log-likelihood: -1260 (df = 11) 
Number of iterations in BFGS optimization: 19 
## IGNORE_RDIFF_END

## visualizations
plot(m, type = "profile")

plot(m, type = "regions")

plot(m, type = "curves")

plot(m, type = "information")

plot(m, type = "piplot")

options(digits = o$digits)