# raschmodel

##### Rasch Model Fitting Function

`raschmodel`

is a basic fitting function for simple Rasch models.

- Keywords
- regression

##### 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`NA`

s 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:

estimated item difficulty parameters (without first item parameter which is always constrained to be 0),

covariance matrix of the parameters in the model,

log-likelihood of the fitted model,

number of estimated parameters,

the original data supplied (excluding columns without variance),

the weights used (if any),

number of observations (with non-zero weights),

status indicator (0, 0/1, 1) of all original items,

logical indicating whether the data contains NAs,

List of elementary symmetric functions for estimated parameters (up to order 2; or 1 in case of numeric derivatives),

convergence code from `optim`

,

number of iterations used by `optim`

,

tolerance passed to `optim`

,

type of derivatives used for computing gradient and Hessian matrix.

##### See Also

##### Examples

```
# NOT RUN {
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)
## 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)
# }
```

*Documentation reproduced from package psychotools, version 0.5-1, License: GPL-2 | GPL-3*