TreeBUGS is an R package that facilitates using hierarchical multinomial processing tree (MPT) models that are often used in cognitive psychology (Erdfelder et al., 2009). Specifically, the Beta-MPT (Smith & Batchelder, 2010) and the latent-trait MPT model (Klauer, 2010) are implemented.

### Using TreeBUGS

In the most simple scenario, the following steps are required:

- Define path to existing MPT model file in .eqn format (cf. multiTree; Moshagen, 2010)
- Define path to data set with individual frequencies (.csv file: comma separated, rows=persons, columns=labeled categories)
- Call
`betaMPT`

or`traitMPT`

(exact code in manual/vignette) - Check convergence of MCMC chains
- Summarize and plot results using functions tailored to MPT models These steps are explained in more detail in the package vignette, which can be opened in R by typing
`vignette("TreeBUGS")`

.

### Installation

Note that TreeBUGS requires a valid installation of the software JAGS. To install the latest stable release of TreeBUGS from CRAN, run:

```
install.packages("TreeBUGS")
```

To install the latest developer version of TreeBUGS from the Github respository (https://github.com/denis-arnold/TreeBUGS), run:

```
install.packages("devtools")
devtools::install_github("denis-arnold/TreeBUGS", build_vignettes = TRUE)
```

### Citation

If you use TreeBUGS, please cite the software as follows:

- Heck, D. W., Arnold, N. R., & Arnold, D. (2018). TreeBUGS: An R package for hierarchical multinomial-processing-tree modeling. Behavior Research Methods, 50, 264–284. doi:10.3758/s13428-017-0869-7

[BibTeX] [Abstract] [Data and R Scripts] [GitHub]Multinomial processing tree (MPT) models are a class of measurement models that account for categorical data by assuming a finite number of underlying cognitive processes. Traditionally, data are aggregated across participants and analyzed under the assumption of independently and identically distributed observations. Hierarchical Bayesian extensions of MPT models explicitly account for participant heterogeneity by assuming that the individual parameters follow a continuous hierarchical distribution. We provide an accessible introduction to hierarchical MPT modeling and present the user-friendly and comprehensive R package TreeBUGS, which implements the two most important hierarchical MPT approaches for participant heterogeneity—the beta-MPT approach (Smith & Batchelder, Journal of Mathematical Psychology 54:167-183, 2010) and the latent-trait MPT approach (Klauer, Psychometrika 75:70-98, 2010). TreeBUGS reads standard MPT model files and obtains Markov-chain Monte Carlo samples that approximate the posterior distribution. The functionality and output are tailored to the specific needs of MPT modelers and provide tests for the homogeneity of items and participants, individual and group parameter estimates, fit statistics, and within- and between-subjects comparisons, as well as goodness-of-fit and summary plots. We also propose and implement novel statistical extensions to include continuous and discrete predictors (as either fixed or random effects) in the latent-trait MPT model.

`@article{heck2018treebugs, title = {{{TreeBUGS}}: {{An R}} Package for Hierarchical Multinomial-Processing-Tree Modeling}, author = {Heck, Daniel W and Arnold, Nina R. and Arnold, Denis}, date = {2018}, journaltitle = {Behavior Research Methods}, volume = {50}, pages = {264--284}, doi = {10.3758/s13428-017-0869-7}, abstract = {Multinomial processing tree (MPT) models are a class of measurement models that account for categorical data by assuming a finite number of underlying cognitive processes. Traditionally, data are aggregated across participants and analyzed under the assumption of independently and identically distributed observations. Hierarchical Bayesian extensions of MPT models explicitly account for participant heterogeneity by assuming that the individual parameters follow a continuous hierarchical distribution. We provide an accessible introduction to hierarchical MPT modeling and present the user-friendly and comprehensive R package TreeBUGS, which implements the two most important hierarchical MPT approaches for participant heterogeneity—the beta-MPT approach (Smith \& Batchelder, Journal of Mathematical Psychology 54:167-183, 2010) and the latent-trait MPT approach (Klauer, Psychometrika 75:70-98, 2010). TreeBUGS reads standard MPT model files and obtains Markov-chain Monte Carlo samples that approximate the posterior distribution. The functionality and output are tailored to the specific needs of MPT modelers and provide tests for the homogeneity of items and participants, individual and group parameter estimates, fit statistics, and within- and between-subjects comparisons, as well as goodness-of-fit and summary plots. We also propose and implement novel statistical extensions to include continuous and discrete predictors (as either fixed or random effects) in the latent-trait MPT model.}, github = {https://github.com/denis-arnold/TreeBUGS}, keywords = {heckfirst}, langid = {english}, osf = {https://osf.io/s82bw} }`

### References

- Erdfelder, E., Auer, T.-S., Hilbig, B. E., Assfalg, A., Moshagen, M., & Nadarevic, L. (2009). Multinomial processing tree models: A review of the literature. Journal of Psychology, 217, 108–124. http://doi.org/10.1027/0044-3409.217.3.108
- Klauer, K. C. (2010). Hierarchical multinomial processing tree models: A latent-trait approach. Psychometrika, 75, 70–98. http://doi.org/10.1007/s11336-009-9141-0
- Matzke, D., Dolan, C. V., Batchelder, W. H., & Wagenmakers, E.-J. (2015). Bayesian estimation of multinomial processing tree models with heterogeneity in participants and items. Psychometrika, 80, 205–235. http://doi.org/10.1007/s11336-013-9374-9
- Moshagen, M. (2010). multiTree: A computer program for the analysis of multinomial processing tree models. Behavior Research Methods, 42, 42–54. http://doi.org/10.3758/BRM.42.1.42
- Smith, J. B., & Batchelder, W. H. (2010). Beta-MPT: Multinomial processing tree models for addressing individual differences. Journal of Mathematical Psychology, 54, 167–183. http://doi.org/10.1016/j.jmp.2009.06.007