plotLongCART {LongCART} | R Documentation |
Plots an LongCART object on the current graphics device.
plotLongCART(x, uniform = FALSE, branch = 1, nspace, margin = 0, minbranch = 0.3, ...)
x |
a fitted object of class |
uniform |
similar to |
branch |
similar to |
nspace |
similar to |
margin |
similar to |
minbranch |
similar to |
... |
arguments to be passed to or from other methods. |
This function is a method for the generic function plot, for objects of class
LongCART
. The y-coordinate of the top node of the tree will always be 1.
The coordinates of the nodes are returned as a list, with components x
and y
.
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.
textLongCART
, 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)