plotLongCART: Plot an LongCART Object

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/plot_n_text_nouse.R

Description

Plots an LongCART object on the current graphics device.

Usage

1
2
plotLongCART(x, uniform = FALSE, branch = 1, nspace,
     margin = 0, minbranch = 0.3, ...)

Arguments

x

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

uniform

similar to plot.rpart; if TRUE, uniform vertical spacing of the nodes is used; this may be less cluttered when fitting a large plot onto a page. The default is to use a non-uniform spacing proportional to the error in the fit.

branch

similar to plot.rpart; controls the shape of the branches from parent to child node. Any number from 0 to 1 is allowed. A value of 1 gives square shouldered branches, a value of 0 give V shaped branches, with other values being intermediate.

nspace

similar to plot.rpart; the amount of extra space between a node with children and a leaf, as compared to the minimal space between leaves. Applies to compressed trees only. The default is the value of branch.

margin

similar to plot.rpart; an extra fraction of white space to leave around the borders of the tree. (Long labels sometimes get cut off by the default computation).

minbranch

similar to plot.rpart; set the minimum length for a branch to minbranch times the average branch length. This parameter is ignored if uniform=TRUE. Sometimes a split will give very little improvement, or even (in the classification case) no improvement at all. A tree with branch lengths strictly proportional to improvement leaves no room to squeeze in node labels.

...

arguments to be passed to or from other methods.

Details

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.

Value

The coordinates of the nodes are returned as a list, with components x and y.

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

textLongCART, LongCART, StabCat, StabCont

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#--- Get the data
#data(ACTG175)
              
#--- Run LongCART()
#gvars=c("age", "gender", "wtkg", "hemo", "homo", "drugs", 
#        "karnof", "oprior", "z30", "zprior", "preanti", "race",
#        "str2", "symptom", "treat", "offtrt")
#tgvars=c(1, 0, 1, 0, 0, 0,
#         1, 0, 0, 0, 1, 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 = TRUE)
#plot(out, compress = TRUE)
#text(out, use.n = TRUE)

LongCART documentation built on Sept. 15, 2019, 3 p.m.