textLongCART {LongCART} | R Documentation |
Labels the current plot of the tree generated from LongCART object with text.
textLongCART(x, splits = TRUE, all = FALSE, use.n = FALSE, minlength = 1L, ...)
x |
a fitted object of class |
splits |
similar to plot.rpart; logical flag. If |
all |
Logical. If TRUE, all nodes are labeled, otherwise just terminal nodes. |
use.n |
Logical. If TRUE, adds |
minlength |
the length to use for factor labels. A value of 1 causes them to be printed as 'a', 'b', ..... Larger values use abbreviations of the label names. See the labels.rpart function for details. |
... |
arguments to be passed to or from other methods. |
Madan Gopal Kundu madan_g.kundu@yahoo.com
Kundu, M. G., and Harezlak, J. (2019). Regression trees for longitudinal data with baseline covariates. Biostatistics & Epidemiology, 3(1):1-22.
plotLongCART
, LongCART
, StabCat
, StabCont
#--- Get the data data(ACTG175) #--- Run LongCART() gvars=c("age", "gender", "wtkg", "hemo", "homo", "drugs", "karnof", "oprior", "z30", "zprior", "race", "str2", "symptom", "treat", "offtrt") tgvars=c(1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0) out<- LongCART(data=ACTG175, patid="pidnum", fixed=cd4~time, gvars=gvars, tgvars=tgvars, alpha=0.05, minsplit=100, minbucket=50, coef.digits=2) #--- Plot tree par(xpd = T) plot(out, compress = T) text(out, use.n = T)