![]() (In extreme cases, reach for linkplot (SSC). See also this Tip.Īlthough the example dataset is well behaved, extra options sort connect(L) will help in some case to remove spurious connections between individuals or panels. To get distinct colours, distinct variables suffice, which is where separate has a role. When frustrated by its wired-in choices, people often just reach for line. There is nothing very special about xtline. Line alcuse? age, legend(off) sort connect(L) Stata xtline overlayed plot for multiple groups Ask Question Asked 6 years, 2 months ago Modified 6 years, 2 months ago Viewed 6k times 2 I am attempting to produce an overlayed -xtline- plot that distinguishes between males and females (or any number of multiple groups) by displaying different plot styles for each group. There is considerable ingenuity in the question code in working through all the identifiers, but a broad-brush approach seems to work as well. Even with this modest dataset there are 82 distinct identifiers, so any attempt to show them distinctly fails to be useful, if only because the resulting legend takes up most of the real estate. It is difficult (for me) to separate the programming issue here from statistical or graphical views on what kind of graph works well, or at all. Xtline alcuse, legend(off) scheme(s1mono) overlay `m_plot_opt' `f_plot_opt' Loc f_plot_opt "`f_plot_opt' plot`i'opts(recast(connected) mcolor(black) msize(medsmall) msymbol(triangle) lcolor(black) lwidth(medthin) lpattern(solid))"ĭi "xtline alcuse, legend(off) scheme(s1mono) overlay `m_plot_opt' `f_plot_opt'" The code below, using publicly available data from UCLA's excellent Stata guide shows my basic code and reproduces the error: use, clear I am aware of this solution which employs combined graphs but that is also not practical given the large number of unique individuals in my data.ĭoes a more simple solution to this problem exist? Does Stata have the capacity to overlay multiple -xtline- plots like it can -twoway- plots? ![]() When I try this solution Stata produces the "too many options" error, which is perhaps predictable given the large number of unique persons. Taking cues from this question on Statalist, I produced code similar to what is below. I fooled around with the x axis labels and title, although that is not my main point. I chose to recast the xtline plot as "connected" and show males using circle markers and females as triangle markers. I am attempting to produce an overlayed -xtline- plot that distinguishes between males and females (or any number of multiple groups) by displaying different plot styles for each group. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |