treeplot: Decision Tree Plot Visualisation for Longitudinal Data

View source: R/longitree.R

treeplotR Documentation

Decision Tree Plot Visualisation for Longitudinal Data

Description

Visualises the structure of a decision tree for longitudinal data. Built on ggparty. Each split node displays the node number, split variable, p-value, and weight w. Each terminal node displays the node number, sample size N, and the intercept (\hat\beta_0) and slope (\hat\beta_1) from a linear mixed-effects model fitted within that node. Individual longitudinal trajectories are shown as dashed lines; the predicted values (average at each time point) are shown as solid lines, with the response variable on the vertical axis and time on the horizontal axis.

Usage

treeplot(
  x,
  tree = NULL,
  snsize = 50,
  spsize = 5,
  plotsize = 80,
  linesize1 = 0.3,
  linesize2 = 1,
  tnsize = 60
)

Arguments

x

A longitree or threetrees object.

tree

Integer 1, 2, or 3 selecting which tree to plot when x is a threetrees object.

snsize

Split-node label size (default 50).

spsize

Split-point label size (default 5).

plotsize

Overall plot size (default 80).

linesize1

Branch line width (default 0.3).

linesize2

Main line width (default 1).

tnsize

Terminal-node label size (default 60).

Value

A ggplot2/ggparty object.

References

Obata, R. and Sugimoto, T. (2026). A decision tree analysis for longitudinal measurement data and its applications. Advances in Data Analysis and Classification. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s11634-025-00665-2")}

See Also

longitree, threetrees


longitree documentation built on May 16, 2026, 5:06 p.m.