简体   繁体   中英

Using terminal panels in plot() after glmtree()

在此处输入图像描述 Using the recursive partitioning model for logit-trees in the following manner

library("partykit")
glmtr <- glmtree(formula = y~t + 1 | (variables)^2,
                 data = dff, 
                 minsize = 500,
                 maxdepth=4,
                 family = binomial)


plot(glmtr, terminal_panel = NULL)

I obtain a plot where the terminal panels overlap with each other and the visual interpretation of the treatment effects (t) turns difficult (specially when including the plot inside a document).

In order to make the plot more visual I have tried to reduce maxdepth=3 . Even though this makes the trick, I lack of information as I am missing many leaves from the tree.

Is there a way to manually reduce the dimension of the terminal panels while keeping a certain number of leafs (eg maxdepth=4 )?

That you in advance:)

In such a situation I recommend to plot the tree on a device that is big enough to show everything and where you can zoom easily etc. For example, one can plot into a big PDF file and then browse and zoom with the PDF viewer. Something like this should work ok:

pdf("glmtr.pdf", height = 10, width = 20)
plot(glmtr, terminal_panel = NULL)
dev.off()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM