Learn R Programming

psychotree (version 0.14-0)

rstree: Rating Scale Tree Models

Description

Recursive partitioning based on rating scale models.

Usage

rstree(formula, data, na.action, reltol = 1e-10,
  deriv = c("sum", "diff"), maxit = 100L, ...)

## S3 method for class 'rstree': predict(object, newdata = NULL, type = c("probability", "cumprobability", "mode", "median", "mean", "category-information", "item-information", "test-information", "node"), personpar = 0, ...)

## S3 method for class 'rstree': plot(x, type = c("regions", "profile"), terminal_panel = NULL, tp_args = list(...), tnex = 2L, drop_terminal = TRUE, ...)

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.
na.action
a function which indicates what should happen when the data contain missing values (NAs).
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.
reltol, maxit
arguments passed via rsmodel to optim.
...
arguments passed to the underlying functions, i.e., to mob_control for rstree, and to the underlying predict and plot methods, respectively.
object, x
an object of class "raschtree".
newdata
optional data frame with partitioning variables for which predictions should be computed. By default the learning data set is used.
type
character specifying the type of predictions or plot. For the predict method, either just the ID of the terminal "node" can be predicted or some property of the model at a given person parameter (specified by pe
personpar
numeric person parameter (of length 1) at which the predictions are evaluated.
terminal_panel, tp_args, tnex, drop_terminal
arguments passed to plot.modelparty/plot.party.

Value

  • An object of S3 class "rstree" inheriting from class "modelparty".

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_regionplot panel-generating function by default.

Various methods are provided for "rstree" objects, most of them inherit their behavior from "modelparty" objects (e.g., print, summary, etc.). For the RSMs in the nodes of a tree, coef extracts all item and threshold parameters except those restricted to be zero. itempar and threshpar extract all item and threshold parameters (including the restricted ones). The plot method by default employs the node_regionplot panel-generating function and the node_profileplot panel-generating function is provided as an alternative.

References

Abou El-Komboz B, Zeileis A, 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
o <- options(digits = 4)

## 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)

## print tree (with and without parameters)
print(rst)
print(rst, FUN = function(x) "*")

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

## visualization
plot(rst, type = "regions")
plot(rst, type = "profile")

## extract item and threshold parameters
coef(rst)
itempar(rst)
threshpar(rst)

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

options(digits = o$digits)

Run the code above in your browser using DataLab