| genBetaMPT {TreeBUGS} | R Documentation | 
Generate Data for Beta MPT Models
Description
Generating a data file with known parameter structure using the Beta-MPT. Useful for simulations and robustness checks.
Usage
genBetaMPT(
  N,
  numItems,
  eqnfile,
  restrictions,
  mean = NULL,
  sd = NULL,
  alpha = NULL,
  beta = NULL,
  warning = TRUE
)
Arguments
| N | number of participants | 
| numItems | number of responses per tree (a named vector with tree labels) | 
| eqnfile | The (relative or full) path to the file that specifies the MPT
model (standard .eqn syntax). Note that category labels must start with a
letter (different to multiTree) and match the column names of  | 
| restrictions | Specifies which parameters should be (a) constant (e.g.,
 | 
| mean | Named vector of true group means of individual MPT parameters. If
the vector is not named, the internal order of parameters is used (can be
obtained using  | 
| sd | named vector of group standard deviations of individual MPT parameters. | 
| alpha | Alternative specification of the group-level distribution using the shape parameters of the beta distribution (see dbeta). | 
| beta | see  | 
| warning | whether to show warning in case the naming of data-generating parameters are unnamed or do not match | 
Details
Data are generated in a two-step procedure. First, person parameters
are sampled from the specified beta distributions for each paramter (either
based on mean/sd or based on alpha/beta). In a second step, response
frequencies are sampled for each person using genMPT.
Value
a list including the generated frequencies (data) and the
true, underlying parameters (parameters) on the group and individual
level.
References
Smith, J. B., & Batchelder, W. H. (2010). Beta-MPT: Multinomial processing tree models for addressing individual differences. Journal of Mathematical Psychology, 54, 167-183.
See Also
Examples
# Example: Standard Two-High-Threshold Model (2HTM)
EQNfile <- system.file("MPTmodels/2htm.eqn", package = "TreeBUGS")
genDat <- genBetaMPT(
  N = 100,
  numItems = c(Target = 250, Lure = 250),
  eqnfile = EQNfile,
  mean = c(Do = .7, Dn = .5, g = .5),
  sd = c(Do = .1, Dn = .1, g = .05)
)
head(genDat$data, 3)
plotFreq(genDat$data, eqn = EQNfile)