Dear Statalisters,
I have a continuous variable X (= 0 ~ 300) and a set of binary variables (say, Y, Z, W). My goal is to plot 3 curves each representing the percentage share that the binary variables equal to 1 along the continuous variable on the same graph.
I am focusing on plotting just one binary variable (say, Y) for now.
I think it is along the line as this:
Except that I would like to have a smooth (kernel like) curve with optimized or pre-determined bin widths.
I have tried to use the kdensity commands but they don't produce what I want. Any help or direction to other posts will be much appreciated.
Thanks for your attention.
I have a continuous variable X (= 0 ~ 300) and a set of binary variables (say, Y, Z, W). My goal is to plot 3 curves each representing the percentage share that the binary variables equal to 1 along the continuous variable on the same graph.
I am focusing on plotting just one binary variable (say, Y) for now.
I think it is along the line as this:
Code:
graph bar (mean) Y, over(X)
I have tried to use the kdensity commands but they don't produce what I want. Any help or direction to other posts will be much appreciated.
Thanks for your attention.
Comment