Dear members,

is there a command that allows to draw a probability tree in Stata?

I have a panel data set of a few thousand employees for several time periods and I have a binary outcome for each observation. I want to draw a plot, which plots the conditional probability of the outcome given the outcome(s) in previous periods. Hence, at the first knot Pr(Y=0) and Pr(Y=1) should be plotted for t = 1. At the second knot (t = 2) four conditional probabilities should be plotted (positive/ negative outcome given positive/ negative outcome in the first period), and so forth.

The probabilities should be just the "descriptive" probabilities (or should I rather say relative frequencies?) as they appear in the sample and should not be based on a regression model.

Best regards
Felix Scholl