Add tag to xline stata12/11/2023 ![]() Use -forvalues- instead of -foreach-, if possible. Graph combine `mysyntax'You can build the syntax for -graph combine- within the loop. Rename (date2 event11 event22) (date event1 event2) I'm relatively new to graphing in Stata so figured this could be left to later. You can add vertical lines to your graph by using xline options for twoway graph (help addedlineoptions). If this has an easy solution, one wrinkle I'll mention is that I actually have "event1" and "event2", and so would eventually like to add multiple vertical lines to each subplot, preferably using different colors. Please use code tags ( ) to post your data. I'm open to reconfiguring the data as necessary. ![]() ![]() Code: clear webuse turksales tsset line sales t, xline(150 150. My plan is to split the plotting statement across groups of markets, but I still need some automated way to add vertical lines (rather than just hardcoding the values in xline() myself for each market). Just to add, this is what I want to produce but I want to calculate the 150 and 150.3 to something that would correspond to where the day would be if I would have a data set with delta one day. I demonstrated how to import series using fredsearch and import fred and how to build a complicated graph out of simpler pieces. My question: for each subplot in the resulting figure, how do I add a vertical line at "1/3/01" in the first subplot and at "1/4/01" in the second subplot? However, instead of having two distinct markets, I have a few hundred. You can import it as an indicator variable into Stata, then use that indicator variable to draw recession shading in a time-series graph. In this case, as noted in the 'Interpretation of repeated options' section of the entry for -help addedlineoptions-, that reasonable thing is sets of lines drawn in different styles. In brief: within each subplot generated by by() using two-way line, I'd like to add possibly more than one vertical line corresponding to a specific date. The -xline()- and -yline()- options are what we call 'merged-implicit', which is a fancy way of saying that you can repeat the option over and over and get something reasonable. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |