Learn R Programming

psychotree (version 0.13-0)

pctree: Partial Credit Tree Models

Description

Recursive partitioning based on partial credit models.

Usage

pctree(formula, data, minsplit = 30, nullcats = c("keep", "downcode",
  "ignore"), reltol = 1e-10,  deriv = c("sum", "diff"),
  hessian = TRUE, maxit = 100L, ...)

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 with items in the columns and observations in the rows and x1 and x2 are used as p
data
a data frame containing the variables in the model.
nullcats
character. How null categories should be treated. See PCModel.fit for details.
deriv
character. If "sum" (the default), the first derivatives of the elementary symmetric functions are calculated with the sum algorithm. Otherwise ("diff") the difference algorithm (faster but numerically unstable) is used.
hessian
logical. Should the Hessian of the final model be computed? If set to FALSE, the vcov method can only return NAs and consequently no standard errors or tests are available in the summary.
reltol, maxit
arguments passed via PCModel to optim.
minsplit, ...
arguments passed to mob_control.

Value

  • An object of S3 class "pctree" which is a list containing only a single element of S4 class "mob" (because this is currently not exported from the party package).

Details

Partial credit tree models are an application of model-based recursive partitioning (implemented in mob) to partial credit models (implemented in PCModel). Various methods are provided for "pctree" objects, most of them inherit their behavior from "mob" objects (e.g., print, summary, etc.). For the partial credit models in the nodes of a tree, coef extracts all threshold parameters. The plot method employs the node_effects panel-generating function by default.

References

Abou El-Komboz, B., Zeileis, A., and Strobl, C. (2014). Detecting Differential Item and Step Functioning with Rating Scale and Partial Credit Trees. Technical Report 152. Department of Statistics, Ludwig- Maximilians-Universitaet Muenchen. http://epub.ub.uni-muenchen.de/17984/

See Also

mob, PCModel, rstree, raschtree

Examples

Run this code
## verbal aggression data from package psychotools
data("VerbalAggression", package = "psychotools")

## use response to the second other-to-blame situation (train)
VerbalAggression$s2 <- VerbalAggression$resp[, 7:12]

## exclude subjects who only scored in the highest or the lowest categories
VerbalAggression <- subset(VerbalAggression, rowSums(s2) > 0 & rowSums(s2) < 12)

## fit partial credit tree model
pct <- pctree(s2 ~ anger + gender, data = VerbalAggression)

## just print mob object
print(pct)

## show summary for terminal panel nodes
summary(pct)

## plot with default (and currently only) terminal panel function (node_effects)
plot(pct)

## extract item and category parameters
coef(pct)

## inspect parameter stability tests in the splitting node
sctest(pct, node = 1)

Run the code above in your browser using DataLab