Rating Scale Trees

Description

Recursive partitioning (also known as trees) 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 partitioning variables. Additionally each item (column) should have the same maximum value (see pctree for a way to handle variable maximum values).
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 personpar).
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.

Details

Rating scale trees are an application of model-based recursive partitioning (implemented in mob) to rating scale models (implemented in rsmodel). See Komboz et al. (2018) for a detailed discussion. For technical and algorithmic details, see the documentation of the two core functions linked above as well as vignette(“mob”, package = “partykit”).

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.

Value

An object of S3 class “rstree” inheriting from class “modelparty”.

References

Komboz B, Zeileis A, Strobl C (2018). Tree-Based Global Model Tests for Polytomous Rasch Models. Educational and Psychological Measurement, 78(1), 128–166. doi:10.1177/0013164416664394

See Also

mob, rsmodel, pctree, raschtree

Examples

library("psychotree")

## IGNORE_RDIFF_BEGIN
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)
Rating scale tree

Model formula:
s1 ~ anger + gender

Fitted party:
[1] root
|   [2] gender in female
|   |   [3] anger <= 23: n = 173
|   |         s1S1DoCurse s1S1WantScold   s1S1DoScold s1S1WantShout   s1S1DoShout 
|   |              0.5054        0.5054        1.0954        1.0688        1.9563 
|   |                  C2 
|   |              0.8887 
|   |   [4] anger > 23: n = 41
|   |         s1S1DoCurse s1S1WantScold   s1S1DoScold s1S1WantShout   s1S1DoShout 
|   |             -0.6582        0.3610        0.2247        0.5922        0.8799 
|   |                  C2 
|   |             -0.7253 
|   [5] gender in male: n = 68
|         s1S1DoCurse s1S1WantScold   s1S1DoScold s1S1WantShout   s1S1DoShout 
|            -0.48160       0.35253      -0.06342       1.01438       1.60990 
|                  C2 
|             0.87640 

Number of inner nodes:    2
Number of terminal nodes: 3
Number of parameters per node: 6
Objective function (negative log-likelihood): 975.8
print(rst, FUN = function(x) " *")
Rating scale tree

Model formula:
s1 ~ anger + gender

Fitted party:
[1] root
|   [2] gender in female
|   |   [3] anger <= 23 *
|   |   [4] anger > 23 *
|   [5] gender in male *

Number of inner nodes:    2
Number of terminal nodes: 3
Number of parameters per node: 6
Objective function (negative log-likelihood): 975.8
## show summary for terminal panel nodes
summary(rst)
$`3`

Rating scale model

Item location and threshold parameters:
              Estimate Std. Error z value Pr(>|z|)    
s1S1DoCurse      0.505      0.157    3.21   0.0013 ** 
s1S1WantScold    0.505      0.157    3.21   0.0013 ** 
s1S1DoScold      1.095      0.166    6.58  4.6e-11 ***
s1S1WantShout    1.069      0.166    6.44  1.2e-10 ***
s1S1DoShout      1.956      0.194   10.08  < 2e-16 ***
C2               0.889      0.157    5.65  1.6e-08 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Log-likelihood: -612 (df = 6) 
Number of iterations in BFGS optimization: 11 


$`4`

Rating scale model

Item location and threshold parameters:
              Estimate Std. Error z value Pr(>|z|)   
s1S1DoCurse     -0.658      0.316   -2.08   0.0374 * 
s1S1WantScold    0.361      0.303    1.19   0.2331   
s1S1DoScold      0.225      0.301    0.75   0.4550   
s1S1WantShout    0.592      0.308    1.92   0.0545 . 
s1S1DoShout      0.880      0.318    2.77   0.0056 **
C2              -0.725      0.347   -2.09   0.0367 * 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Log-likelihood: -132 (df = 6) 
Number of iterations in BFGS optimization: 12 


$`5`

Rating scale model

Item location and threshold parameters:
              Estimate Std. Error z value Pr(>|z|)    
s1S1DoCurse    -0.4816     0.2566   -1.88  0.06058 .  
s1S1WantScold   0.3525     0.2548    1.38  0.16650    
s1S1DoScold    -0.0634     0.2519   -0.25  0.80121    
s1S1WantShout   1.0144     0.2731    3.71  0.00020 ***
s1S1DoShout     1.6099     0.3034    5.31  1.1e-07 ***
C2              0.8764     0.2568    3.41  0.00064 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Log-likelihood: -232 (df = 6) 
Number of iterations in BFGS optimization: 12 
## visualization
plot(rst, type = "regions")

plot(rst, type = "profile")

## extract item and threshold parameters
coef(rst)
  s1S1DoCurse s1S1WantScold s1S1DoScold s1S1WantShout s1S1DoShout      C2
3      0.5054        0.5054     1.09541        1.0688      1.9563  0.8887
4     -0.6582        0.3610     0.22465        0.5922      0.8799 -0.7253
5     -0.4816        0.3525    -0.06342        1.0144      1.6099  0.8764
itempar(rst)
  s1S1WantCurse s1S1DoCurse s1S1WantScold s1S1DoScold s1S1WantShout s1S1DoShout
3       -0.8552     -0.3498      -0.34978    0.240193        0.2135      1.1010
4       -0.2333     -0.8915       0.12775   -0.008599        0.3589      0.6466
5       -0.4053     -0.8869      -0.05277   -0.468721        0.6091      1.2046
  s1S1WantCurse-C1 s1S1WantCurse-C2 s1S1DoCurse-C1 s1S1DoCurse-C2
3          -1.2996          -0.4108        -0.7941        0.09459
4           0.1294          -0.5959        -0.5289       -1.25411
5          -0.8435           0.0329        -1.3251       -0.44870
  s1S1WantScold-C1 s1S1WantScold-C2 s1S1DoScold-C1 s1S1DoScold-C2
3          -0.7941          0.09459        -0.2042        0.68456
4           0.4904         -0.23487         0.3540       -0.37123
5          -0.4910          0.38543        -0.9069       -0.03052
  s1S1WantShout-C1 s1S1WantShout-C2 s1S1DoShout-C1 s1S1DoShout-C2
3          -0.2308         0.657908         0.6567          1.545
4           0.7216        -0.003693         1.0093          0.284
5           0.1709         1.047277         0.7664          1.643
## inspect parameter stability tests in all splitting nodes
if(require("strucchange")) {
sctest(rst, node = 1)
sctest(rst, node = 2)
}
             anger gender
statistic 23.61167      0
p.value    0.01672     NA
options(digits = o$digits)
## IGNORE_RDIFF_END