![]() (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) 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' Cox Department of Geography Durham University Durham, UK n.j.coxdurham.ac.uk Grids of horizontal or vertical lines within graphs were greatly used in the past, but more recently have been greatly disapproved. 648651 Stata tip 82: Grounds for grids on graphs Nicholas J. 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 Stata Journal (2009) 9, Number 4, pp. I chose to recast the xtline plot as 'connected' and show males using circle markers and females as triangle markers. 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 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. 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. mean (default), count, max, etc.) is very convenient as it saves you from constructing another dataset just to draw the graphs. I chose to recast the xtline plot as "connected" and show males using circle markers and females as triangle markers. The (stat) option, which allows you to specify all stats options used by the command -collapse- (e.g. 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. |