README.md

CRAN_Status_Badge Workflow CRAN/METACRAN monthly downloads total downloads

TreeBUGS

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, TreeBUGS implements the Bayesian estimation via MCMC sampling for the Beta-MPT (Smith & Batchelder, 2010), the latent-trait MPT model (Klauer, 2010), and standard (fixed-effects) MPT models.

General Approach of Using TreeBUGS

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

  1. Define path to existing MPT model file in .eqn format (cf. multiTree; Moshagen, 2010)
  2. Define path to data set with individual frequencies (.csv file: comma separated, rows=persons, columns=labeled categories)
  3. Call betaMPT or traitMPT (exact code in manual/vignette)
  4. Check convergence of MCMC chains
  5. 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").

Tutorial on MPT Modeling

A tutorial paper on multinomial processing tree models (including hierarchical model fitting with TreeBUGS) can be found here:

Installing TreeBUGS

TreeBUGS requires the software JAGS. To install the latest release of TreeBUGS from CRAN, type the following into the R console:

install.packages("TreeBUGS")

To install the latest developer version of TreeBUGS from GitHub, run:

### Dependencies:
install.packages(c("devtools", "coda", "runjags", "hypergeo", "testthat",
                   "rjags", "Rcpp", "RcppArmadillo", "logspline"))
devtools::install_github("danheck/TreeBUGS", build_vignettes = TRUE)

To compile C++ code, Windows and Mac require Rtools and Xcode Command Line Tools, respectively. Moreover, on Mac, it might be necessary to install the library gfortran manually by typing the following into the console (required to compile the package RcppArmadillo):

curl -O http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2
sudo tar fvxz gfortran-4.8.2-darwin13.tar.bz2 -C /

Citation

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

References



denis-arnold/TreeBUGS documentation built on May 13, 2024, 6:34 p.m.