mpttree: MPT Trees

Description Usage Arguments Details Value References See Also Examples

View source: R/mpttree.R

Description

Recursive partitioning (also known as trees) based on multinomial processing tree (MPT) models.

Usage

1
2
3
mpttree(formula, data, na.action, cluster, spec, treeid = NULL,
  optimargs = list(control = list(reltol = .Machine$double.eps^(1/1.2),
                                  maxit = 1000)), ...)

Arguments

formula

a symbolic description of the model to be fit. This should be of type y ~ x1 + x2 where y should be a matrix of response frequencies and x1 and x2 are used as partitioning variables.

data

an optional data frame containing the variables in the model.

na.action

a function which indicates what should happen when the data contain NAs, defaulting to na.pass.

cluster

optional vector (typically numeric or factor) with a cluster ID to be employed for clustered covariances in the parameter stability tests.

spec, treeid, optimargs

arguments for the MPT model passed on to mptmodel.

...

arguments passed to mob_control.

Details

MPT trees (Wickelmaier & Zeileis, 2016) are an application of model-based recursive partitioning (implemented in mob) to MPT models (implemented in mptmodel).

Various methods are provided for "mpttree" objects, most of them inherit their behavior from "mob" objects (e.g., print, summary, etc.). The plot method employs the node_mptplot panel-generating function.

Value

An object of S3 class "mpttree" inheriting from class "modelparty".

References

Wickelmaier F, Zeileis A (2016). “Using Recursive Partitioning to Account for Parameter Heterogeneity in Multinomial Processing Tree Models”. Working Paper 2016-26. Working Papers in Economics and Statistics, Research Platform Empirical and Experimental Economics, Universität Innsbruck. http://EconPapers.RePEc.org/RePEc:inn:wpaper:2016-26

See Also

mob, mptmodel.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
o <- options(digits = 4)

## Source Monitoring data
data("SourceMonitoring", package="psychotools")

## MPT tree
sm_tree <- mpttree(y ~ sources + gender + age, data = SourceMonitoring,
  spec = mptspec("SourceMon", .restr = list(d1 = d, d2 = d)))
plot(sm_tree, index = c("D1", "D2", "d", "b", "g"))

## extract parameter estimates
coef(sm_tree)

## parameter instability tests in root node
library("strucchange")
sctest(sm_tree, node = 1)

## storage and retrieval deficits in psychiatric patients
data("MemoryDeficits", package = "psychotools")
MemoryDeficits$trial <- ordered(MemoryDeficits$trial)

## MPT tree
sr_tree <- mpttree(cbind(E1, E2, E3, E4) ~ trial + group,
  data = MemoryDeficits, cluster = ID, spec = mptspec("SR2"), alpha = 0.1)

## extract parameter estimates
coef(sr_tree)

options(digits = o$digits)

psychotree documentation built on May 29, 2017, 3:11 p.m.