I just said
> I didn't get as far as thinking
> about how you would distinguish the lines on
> the graph.
That referred to this code:
> levels id, local(levels)
> foreach l of local levels {
> // next line clears macro
> local events
> forval i = 1/3 {
> su event`i' if id == `l', meanonly
> if r(max) < . local events "`events'`r(max)' "
> }
> if "`events'" != "" {
> xtline response if id == `l', ///
> subtitle(panel `l') xline(`events')
> }
> else xtline response if id == `l', subtitle(panel `l')
> more
> }
>
One approach would be something like this
tokenize "solid dash dot"
levels id, local(levels)
foreach l of local levels {
// next line clears macro
local xlopt
forval i = 1/3 {
su event`i' if id == `l', meanonly
if r(max) < . ///
local xlopt "`xlopt' xli(`r(max)', lp(``i''))"
}
xtline response if id == `l', ///
subtitle(panel `l') `xlopt'
more
}
Nick
[email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/