(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' 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 crux of the matter is that Stata deals with dates as integers that have a special label attached to them by the format command (but not a value label). 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 chose to recast the xtline plot as "connected" and show males using circle markers and females as triangle markers. ![]() > What I'd really like is for the numerical x labels to be there (stata default is fine) but with these additional vertical lines being labeled somewhere, there is space on the graph but I can't figure out how to do it.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 can tell it to put some of the tick marks back on by writing xlabel( 25 50 "2 Stars"), but that also looks strange. ![]() > It replaces the tick marks with my "2 Stars" etc. lines, see the grid option in G-3 axis label options. > histogram totalpoints, discrete percent xline(50 75 100 125) xlabel(50 "2 Stars" 75 "3 Stars" 100 "4 Stars" 125 "5 Stars") yline(), xline(), and tline() are used with twoway to add lines to the plot region. > I'd like to label them, but when I run the code ![]() > histogram totalpoints, discrete percent xline(50 75 100 125) > I am making a histogram using data that ranges from 0-200 where I have four vertical lines that are important to my data: Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |