Fits an Extended NOminal Response Model (ENORM) using conditional maximum likelihood (CML) or a Gibbs sampler for Bayesian estimation.

```
fit_enorm(
dataSrc,
predicate = NULL,
fixed_params = NULL,
method = c("CML", "Bayes"),
nDraws = 1000,
merge_within_persons = FALSE
)
```

- dataSrc
a connection to a dexter database, a matrix, or a data.frame with columns: person_id, item_id, item_score

- predicate
An optional expression to subset data, if NULL all data is used

- fixed_params
Optionally, a prms object from a previous analysis or a data.frame with parameters, see details.

- method
If CML, the estimation method will be Conditional Maximum Likelihood; otherwise, a Gibbs sampler will be used to produce a sample from the posterior

- nDraws
Number of Gibbs samples when estimation method is Bayes.

- merge_within_persons
whether to merge different booklets administered to the same person, enabling linking over persons as well as booklets.

An object of type `prms`

. The prms object can be cast to a data.frame of item parameters
using function `coef`

or used directly as input for other Dexter functions.

The eNRM is a slight generalization of the PCM and/or the OPLM. It reduces to the Rach model for dichotomous items when all itemscores are 0 or 1, is equal to the PCM for polytomous items if all itemscores up to the maximum score occur, otherwise is equal to the oplm if all itemscores have an equal common divisor larger than 1.

To support some flexibility in fixing parameters, fixed_params can be a dexter prms object or a data.frame. If a data.frame, it should contain the columns item_id, item_score and a difficulty parameter

Maris, G., Bechger, T.M. and San-Martin, E. (2015) A Gibbs sampler for the (extended) marginal Rasch model. Psychometrika. 80(4), 859-879.

Koops, J. and Bechger, T.M. and Maris, G. (in press); Bayesian inference for multistage and other incomplete designs. In Research for Practical Issues and Solutions in Computerized Multistage Testing. Routledge, London.

functions that accept a prms object as input: `ability`

, `plausible_values`

,
`plot.prms`

, and `plausible_scores`