Dear all,
I am struggling with adding colors to a profileplot. I have a dataset with a variable (var1) before and after a certain condition.
My idea is to have a panel with two plots. The first would be a plot where the observations had a decreasing var1, and the second plot with all observations who had an increasing var1 (before/after). By default, profileplot add different colors to each line (observation), but I would like to add a color for all the lines in plot1, and a different in plot2.
I tried this without success:
profileplot var1_before var1_after if group==1, by(id) name(g1, replace) lcolor(red)
profileplot var1_before var1_after if group==2, by(id) name(g2, replace) lcolor(blue)
graph combine g1 g2
Sure there is other way to plot them. Do you have any advice?
Thanks!
David
I am struggling with adding colors to a profileplot. I have a dataset with a variable (var1) before and after a certain condition.
My idea is to have a panel with two plots. The first would be a plot where the observations had a decreasing var1, and the second plot with all observations who had an increasing var1 (before/after). By default, profileplot add different colors to each line (observation), but I would like to add a color for all the lines in plot1, and a different in plot2.
I tried this without success:
profileplot var1_before var1_after if group==1, by(id) name(g1, replace) lcolor(red)
profileplot var1_before var1_after if group==2, by(id) name(g2, replace) lcolor(blue)
graph combine g1 g2
Sure there is other way to plot them. Do you have any advice?
Thanks!
David
Comment