mpt.Rd
Fits a (joint) multinomial processing tree (MPT) model specified
by a symbolic description via mptspec
.
mpt(spec, data, start = NULL, method = c("BFGS", "EM"), treeid = "treeid",
freqvar = "freq", optimargs =
if(method == "BFGS") list(control =
list(reltol = .Machine$double.eps^(1/1.2), maxit = 1000))
else list())
# S3 method for class 'mpt'
anova(object, ..., test = c("Chisq", "none"))
# S3 method for class 'mpt'
coef(object, logit = FALSE, ...)
# S3 method for class 'mpt'
confint(object, parm, level = 0.95, logit = TRUE, ...)
# S3 method for class 'mpt'
predict(object, newdata = NULL, type = c("freq", "prob"), ...)
# S3 method for class 'mpt'
summary(object, ...)
an object of class mptspec
: typically result of a call to
mptspec
. A symbolic description of the model to be
fitted. (See Details and Examples.)
a data frame consisting at least of one variable that contains the absolute response frequencies. Alternatively, a (named) vector or matrix of frequencies.
a vector of starting values for the parameter estimates between zero and one.
optimization method. Implemented are
optim(..., method = "BFGS")
and the EM algorithm.
name of the variable that identifies the processing trees of a joint multinomial model. Alternatively, a factor that identifies each tree.
if data
is a data frame, name of the variable that
holds the response frequencies; else ignored.
logical. Parameter estimates on logit or probability scale.
a list of arguments passed to the optimization function,
either optim
or mptEM
.
an object of class mpt
, typically the result of a
call to mpt
.
should the p-values of the chi-square distributions be reported?
See confint.default
.
a vector of response frequencies.
predicted frequencies or probabilities.
additional arguments passed to other methods.
Multinomial processing tree models (Batchelder & Riefer, 1999; Erdfelder et al., 2009; Riefer & Batchelder, 1988) seek to represent the categorical responses of a group of subjects by a small number of latent (psychological) parameters. These models have a tree-like graph, the links being the parameters, the leaves being the response categories. The path from the root to one of the leaves represents the cognitive processing steps executed to arrive at a given response.
If data
is a data frame, each row corresponds to one response
category. If data
is a vector or matrix, each element or column
corresponds to one response category. The order of response categories and
of model equations specified in mptspec
should match.
Joint (or product) multinomial models consist of more than one processing
tree. The treeid
should uniquely identify each tree.
Per default, parameter estimation is carried out by optim
's
BFGS method on the logit scale with analytical gradients; it can be switched
to mptEM
which implements the EM algorithm.
An object of class mpt
containing the following components:
a vector of parameter estimates. For extraction, the
coef
function is preferred.
the log-likelihood of the fitted model.
the number of nonredundant response categories.
the fitted response frequencies.
the goodness of fit statistic including the likelihood ratio fitted vs. saturated model (G2), the degrees of freedom, and the p-value of the corresponding chi-square distribution.
the number of trees in a joint multinomial model.
the total number of observations per tree.
the vector of response frequencies.
the predicted probabilities for each response category.
a factor that identifies each tree.
structural constants passed to mptEM
.
the MPT model specification returned by mptspec
.
the optimization method used.
the return value of the optimization function.
Batchelder, W.H., & Riefer, D.M. (1999). Theoretical and empirical review of multinomial process tree modeling. Psychonomic Bulletin & Review, 6(1), 57–86. doi:10.3758/bf03210812
Erdfelder, E., Auer, T., Hilbig, B.E., Assfalg, A., Moshagen, M., & Nadarevic, L. (2009). Multinomial processing tree models: A review of the literature. Zeitschrift fuer Psychologie, 217(3), 108–124. doi:10.1027/0044-3409.217.3.108
Riefer, D.M., & Batchelder, W.H. (1988). Multinomial modeling and the measurement of cognitive processes. Psychological Review, 95(3), 318–339. doi:10.1037/0033-295x.95.3.318
## Storage-retrieval pair-clustering model (Riefer & Batchelder, 1988)
data(retroact)
spec <- mptspec(
c*r,
(1 - c)*u^2,
2*(1 - c)*u*(1 - u),
c*(1 - r) + (1 - c)*(1 - u)^2,
u,
1 - u
)
m <- mpt(spec, retroact[retroact$lists == 0, ])
summary(m) # parameter estimates, goodness of fit
#>
#> Coefficients:
#> Estimate Logit Estim. Std. Error z value Pr(>|z|)
#> c 0.8771 1.96526 0.30061 6.537 6.26e-11 ***
#> r 0.7373 1.03187 0.21326 4.838 1.31e-06 ***
#> u 0.5095 0.03809 0.21372 0.178 0.859
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Likelihood ratio G2: 0.0169 on 1 df, p-value: 0.8966
#> Pearson X2: 0.017, AIC: 23.397
#> Number of trees: 2
plot(m) # residuals versus predicted values
confint(m) # approximate confidence intervals
#> 2.5 % 97.5 %
#> logit(c) 1.3760628 2.5544516
#> logit(r) 0.6138744 1.4498574
#> logit(u) -0.3807958 0.4569747
plot(coef(m), axes = FALSE, ylim = 0:1, pch = 16, xlab = "",
ylab = "Parameter estimate (MPT model, 95% CI)")
axis(1, 1:3, names(coef(m))); axis(2)
arrows(1:3, plogis(confint(m))[, 1], 1:3, plogis(confint(m))[, 2],
.05, 90, 3)
## See data(package = "mpt") for application examples.