2

I computed a conditional recursive partitioning tree in R with that code:

library(partykit)

fit.all.cov <-ctree(as.factor(status) ~ Age.groups + Sex + Education + Migrant.background + Income + Living.situation, data = training_cov,control = ctree_control(maxdepth = 3))
plot(fit.all.cov, gp = gpar(fontsize = 6))

Here is the output:

enter image description here

I'd like to have in a rectangular box the written percentage of deaths in each terminal node with the population size of each terminal node (n=) in each rectangular box (so instead of barplots having the numerical values). Does anyone know how can I customize the plot() code to remove the barplot and obtain the numerical values?

Thank you !

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.