Learn R Programming

psychotree (version 0.13-0)

rstree: Rating Scale Tree Models

Description

Recursive partitioning based on rating scale models.

Usage

rstree(formula, data, minsplit = 20, 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.
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 RSModel to optim.
minsplit, ...
arguments passed to mob_control.

Value

  • An object of S3 class c("rstree", "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

Rating scale tree models are an application of model-based recursive partitioning (implemented in mob) to rating scale models (implemented in RSModel). Various methods are provided for "rstree" objects, most of them inherit their behavior from "mob" objects (e.g., print, summary, etc.). For the rating scale models in the nodes of a tree, coef extracts all item 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, RSModel, pctree, raschtree

Examples

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

## responses to the first other-to-blame situation (bus)
VerbalAggression$s1 <- VerbalAggression$resp[, 1:6]

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

## fit rating scale tree model for the first other-to-blame situation
rst <- rstree(s1 ~ anger + gender, data = VerbalAggression)

## just print mob object
print(rst)

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

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

## extract item and category parameters
coef(rst)

## inspect parameter stability tests in all splitting nodes
sctest(rst, node = 1)
sctest(rst, node = 2)

Run the code above in your browser using DataLab