LogicReg (version 1.5.12)

plot.logregtree: A plot of one Logic Regression tree.

Description

Makes a plot of one Logic Regression tree, fitted by logreg.

Usage

# S3 method for logregtree
plot(x, nms, full=TRUE, and.or.cx=1.0, leaf.sz=1.0, 
                leaf.txt.cx=1.0, coef.cx=1.0, indents=rep(0,4), coef=TRUE,
                coef.rd=4, ...)

Arguments

x

an object of class logregtree, or the trees component of such an object. Typically this object will be part of the result of an object of class logreg, generated with select = 1 (single model fit) or select = 2 (multiple model fit).

nms

names of variables. If nms is provided variable names will be plotted, otherwise indices will be used.

full

if TRUE, the tree occupies the entire window with margins specified by indents.

and.or.cx

character expansion (size) for the operators and/or.

leaf.sz

character expansion for the size of the leaves.

leaf.txt.cx

character expansion for the text in the leaves.

coef.cx

character expansion for the coefficient string.

indents

indents for plot - bottom, left, top, right.

coef

if TRUE, the coefficient of the tree is plotted.

coef.rd

controls how many digits of the above coefficient are displayed.

...

graphical parameters can be given as arguments to plot.

Value

This function makes a plot of one logic tree. The character expansion terms (and.or.cx, leaf.sz, leaf.txt.cx, coef.cx) defaults of 1.0 are chosen to generate a pretty plot of a single tree with up to eight leaves (4 levels deep). To plot more than one tree, or trees of different complexity, scale accordingly.

References

Ruczinski I, Kooperberg C, LeBlanc ML (2003). Logic Regression, Journal of Computational and Graphical Statistics, 12, 475-511.

Ruczinski I, Kooperberg C, LeBlanc ML (2002). Logic Regression - methods and software. Proceedings of the MSRI workshop on Nonlinear Estimation and Classification (Eds: D. Denison, M. Hansen, C. Holmes, B. Mallick, B. Yu), Springer: New York, 333-344.

Selected chapters from the dissertation of Ingo Ruczinski, available from http://kooperberg.fhcrc.org/logic/documents/ingophd-logic.pdf

See Also

logreg, frame.logreg, logreg.testdat

Examples

Run this code
# NOT RUN {
data(logreg.savefit2)
# 
# myanneal2 <- logreg.anneal.control(start = -1, end = -4, iter = 25000, update = 0)
# logreg.savefit2 <- logreg(resp = logreg.testdat[,1], bin=logreg.testdat[, 2:21],
#                type = 2, select = 2, ntrees = c(1,2), nleaves =c(1,7),
#                anneal.control = myanneal2)
for(i in 1:logreg.savefit2$nmodels) for(j in 1:logreg.savefit2$alltrees[[i]]$ntrees[1]){
   plot.logregtree(logreg.savefit2$alltrees[[i]]$trees[[j]])
   title(main=paste("model",i,"tree",j))
}
# }

Run the code above in your browser using DataCamp Workspace