I need to plot a conditional inference tree. I have selected the party::ctree() function. It works on the iris dataset.
library(party)
(irisct_party <- party::ctree(Species ~ .,data = iris))
plot(irisct_party)
But when I using the random data
library(wakefield)
set.seed(123)
n=200
studs <- data.frame(problem = factor(answer(n, x = c("No", "Yes"))),
age = round(runif(n, 18, 25)),
gender = factor(answer(n, x = c("M", "F" ))),
smoker = factor(answer(n, x = c("No", "Yes" ))),
before = round(runif(n, 60, 80)),
after = before + round(runif(n, 10, 20))
)
(ct <- party::ctree(problem ~ ., data = studs))
plot(ct)
I see just
Conditional inference tree with 1 terminal nodes
Response: problem
Inputs: age, gender, smoker, before, after
Number of observations: 200
1)* weights = 200
Question. Why is the conditional inference tree has 1 terminal node on random data?