diffIRT {diffIRT} | R Documentation |

This function fits the D-diffusion or the Q-diffusion IRT model to response and response time data using marginal maximum likelihood. Item parameters that are estimated are item drift rate, v[i] item boundary separation, a[i], and item specific non-decision time, Ter[i]. Population parameters that are estimated are omega[gamma] and omega[theta], which are scale parameters for the person boundary separation and person drift rate respectively. Parameters can be submitted to equality and/or fixed value constraints.

diffIRT(rt, x, model="D", constrain=NULL, start=NULL, se=F, control=list())

`rt` |
A matrix of size |

`x` |
A matrix of |

`model` |
String; Either "D" to fit the D-diffusion IRT model or "Q" to fit the Q-diffusion IRT model. |

`constrain` |
If |

`start` |
If |

`se` |
Logical; Denoting whether standard errors of the parameters should be estimated (this will increase computation time, default is |

`control` |
a list of control values for the optimizations |

- nq
Vector of any length containing the number of quadrature points that should be used in successive optimizations. Optimisation will start using the number of quadratures points specified in the first element. When converged, the resulting parameter estimates will be used as starting values in a new optimisation using the number of quadrature points from the second element. This process continues until the end of vector

`nq`

is reached. Default is c(7).- method
The optimisation method used by

`optim`

. Default "BFGS".- eps
Precision with which the infinite integral in the likelihood function is approximated. Default is 0.01. See

**Details**.- delta
Precision used in the finite difference approximation of the gradient. Default is 1e-7.

- trace
See

`optim`

for details and default.- fnscale
See

`optim`

for details and default.- parscale
See

`optim`

for details and default.- maxit
See

`optim`

for details. Default is 1999.- reltol
See

`optim`

for details and default.

`diffIRT`

fits either the D-diffusion or the Q-diffusion IRT model to data by
minimizing -2 times the log marginal likelihood function using `optim`

.
In the diffusion IRT model the traditional parameters from the diffusion model,
boundary separation and drift rate are decomposed into person and item parameters
(see van der Maas et al., 2011; Tuerlinckx & De Boeck, 2005).
This results in: item boundary parameter *a[i]*, item drift parameter *v[i]*,
person boundary *gamma[p]*, and person drift *theta[p]*. The model
for the responses in the D-diffusion IRT model is then:

*logit(x[p,i]) = gamma[p]/a[i] x (theta[i]-v[i]),*

where *gamma[p] >= 0* and *ai[i] >= 0*. The Q-diffusion IRT model for the
responses is given by:

*logit(x[p,i]) = gamma[p]/a[i] x (theta[p]/v[i]).*

where *gamma[p] >= 0*, *a[i] >= 0*, *theta[p] >= 0*, and *theta[p] >= 0*.
As discussed in van der Maas et al. (2011), this setup makes the D-diffusion IRT model
suitable for personality data and the Q-diffusion IRT model for ability data.
The response times follow a distribution according to a Wiener process which includes
- in addition to the parameters above - a non-decision parameter for each
item, *Ter[i]*. For the random effects, *theta[p]* and *gamma[p]* scale parameters are estimated
which are respectively, *omega[gamma]* and *omega[theta]*. The joint distribution of
responses and response times is evaluated using the approach
by Navarro & Fuss (2009). In this approach, the infinite sum in the density function
of the diffusion model is being approximated with a maximum discrepancy of `epsilon`

. This discrepancy can be
set using the `eps`

setting within the `control`

argument. To facilitated numerical estimation, the natural logarithm
of the parameters that are strictly positive are estimated (i.e., `log(a[i])`

, `log(Ter[i])`

,
`log(omega[gamma])`

, `log(omega[theta])`

, and `log(v[i])`

in the Q-diffusion model). However, in the output
the parameters are transformed back to their original scale. In addition, if `se=T`

,
standard errors for the original parameters are calculated from the standard errors
of the transformed parameters using the delta method.

Because gamma[p] and theta[p] in the Q-diffusion model and gamma[p] in the D-diffusion model can
only be positive, their population distribution is assumed to be normal on the log-scale.
As a consequence, gamma[p] and theta[p] follow a log-normal distribution. Thus, in the Q-diffusion model `gamma[p]`

and `theta[p]`

are
log-normally distributed with scale parameters `omega[gamma]`

and `omega[theta]`

respectively. In case of the
D-diffusion model, `theta[p]`

is distributed log-normally with scale parameter `omega[gamma]`

, and `theta[p]`

is distributed normally with scale parameter `omega[theta]`

which equals the standard deviation.

By default, starting values are calculated using the EZ-diffusion model (Wagemakers, van der Maas, & Grasman, 2007).

For more details see Molenaar, Tuerlinkcx, & van der Maas (2013).

An object of class `diffIRT`

with values

` start.val` |
starting values |

` par` |
parameter estimates |

` par.log` |
log-transformed parameters (note that for the D-diffusion model v[i] is not transformed, see |

` std.err` |
if argument |

` totLL ` |
value of -2 times the log-marginal likelihood at convergence |

` npars` |
number of parameters in the model |

` AIC` |
AIC |

` BIC` |
BIC |

` sBIC` |
sample size adjusted BIC |

` DIC` |
DIC |

` subjLL` |
a vector of size |

` hist` |
a matrix containing the history of the optimisation procedure. First row contains the starting values. Next rows
contain the successive optimizations using the different number of quadrature points as specified in |

` conv` |
integer convergence status returned by optim |

` nr_fail` |
the number of subjects for which the likelihood function was intractable (i.e., for these subjects, the log-likelihood approaches minus infinity). This could be due to the starting values, or due to extremely fast response times. |

Dylan Molenaar d.molenaar@uva.nl

Molenaar, D., Tuerlinkcx, F., & van der Maas, H.L.J. (2015). Fitting Diffusion Item Response Theory Models for Responses and Response Times Using the R Package diffIRT.
*Journal of Statistical Software*, **66(4)**, 1-34. URL http://www.jstatsoft.org/v66/i04/.

Navarro, D.J. & Fuss, I.G. (2009). Fast and accurate calculations for first-passagetimes in Wiener diffusion models.
*Journal of Mathematical Psychology*, **53**, 222-230.

Tuerlinckx, F., & De Boeck, P. (2005). Two interpretations of the discrimination parameter. *Psychometrika*, **70**, 629-650.

van der Maas, H.L.J., Molenaar, D., Maris, G., Kievit, R.A., & Borsboom, D. (2011). Cognitive psychology meets psychometric theory:
On the relation between process models for decision making and latent variable models for individual differences.
*Psychological Review*, **118**, 339-356.

Wagenmakers, E. J., Van Der Maas, H. L., & Grasman, R. P. (2007). An EZ-diffusion model for response time and accuracy.
*Psychonomic Bulletin & Review*, **14**, 3-22.

`simdiff`

for simulating data according to the D-diffusion or Q-diffusion IRT model.
`factest`

for estimation of factor scores (person drift rate and person boundary separation).
`QQdiff`

and RespFit for model fit assessment.
`summary.diffIRT`

for a overview of the model estimation results, including model fit statistics.
`anova.diffIRT`

to conduct a likelihood ratio test between two nested diffIRT models.
`coef.diffIRT`

to extract parameter estimates.

## Not run: # open extraversion data data(extraversion) x=extraversion[,1:10] rt=extraversion[,11:20] # fit an unconstrained D-diffusion model res1=diffIRT(rt,x,model="D") # fit a model with equal item boundaries, a[i] using the manual setup res2=diffIRT(rt,x,model="D", constrain=c(rep(1,10),2:11,12:21,22,23)) # fit a model with equal item boundaries, a[i] using the preprogrammed setup res2=diffIRT(rt,x,model="D", constrain="ai.equal") # fit a model where all item drift parameters,vi, are fixed to 0. res3=diffIRT(rt,x,model="D", constrain=c(1:10,rep(0,10),11:20,21,22), start=c(rep(NA,10),rep(0,10),rep(NA,10),NA,NA)) # fit a model without random person boundary parameters. res3=diffIRT(rt,x,model="D", constrain=c(1:30,0,31), start=c(rep(NA,30),0,NA)) ## End(Not run)

[Package *diffIRT* version 1.5 Index]