textLongCART {LongCART}R Documentation

Place text on LongCART tree

Description

Labels the current plot of the tree generated from LongCART object with text.

Usage

textLongCART(x, splits = TRUE, all = FALSE, 
             use.n = FALSE, minlength = 1L, ...)

Arguments

x

a fitted object of class "LongCART", containing a linear mixed effects tree.

splits

similar to plot.rpart; logical flag. If TRUE (default), then the splits in the tree are labeled with the criterion for the split.

all

Logical. If TRUE, all nodes are labeled, otherwise just terminal nodes.

use.n

Logical. If TRUE, adds n to label.

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.

Author(s)

Madan Gopal Kundu madan_g.kundu@yahoo.com

References

Kundu, M. G., and Harezlak, J. (2019). Regression trees for longitudinal data with baseline covariates. Biostatistics & Epidemiology, 3(1):1-22.

See Also

plotLongCART, LongCART, StabCat, StabCont

Examples

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

[Package LongCART version 1.0 Index]