In lieu of having a reference line in the graph legend, I wanna denote when the intervention date is. Consider
That is, I want it to read "Intervention happens at 2004q1", instead of what it currently reads. How might I do this?
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input float(time gdp9) double cf float(relative diff_ te_ub te_lb cf_ub cf_lb)
132 .062 .055180247266846616 -44 .006819752 .02577609 -.01213659 . .
133 .059 .05737932538437747 -43 .001620675 .020577015 -.017335664 . .
134 .058 .056148609669449484 -42 .0018513887 .02080773 -.017104952 . .
135 .062 .06533847423519512 -41 -.003338475 .015617865 -.022294816 . .
136 .079 .04637564153004864 -40 .032624364 .0515807 .013668024 . .
137 .068 .05424769272380592 -39 .01375231 .032708652 -.00520403 . .
138 .046 .04760016478218274 -38 -.0016001647 .017356176 -.020556506 . .
139 .052 .04726630016525215 -37 .004733701 .02369004 -.01422264 . .
140 .037 .04920234093523755 -36 -.01220234 .006754 -.03115868 . .
141 .029 .026194977125657052 -35 .002805022 .02176136 -.016151318 . .
142 .012 .027652846175755672 -34 -.015652847 .0033034936 -.034609187 . .
143 .015 .01747633810709347 -33 -.0024763385 .016480003 -.02143268 . .
144 .025 .035071621168368476 -32 -.01007162 .00888472 -.02902796 . .
145 .036 .04447716839250727 -31 -.00847717 .01047917 -.02743351 . .
146 .047 .052810033518747905 -30 -.005810035 .013146305 -.024766374 . .
147 .059 .06263078623192628 -29 -.003630786 .015325555 -.022587126 . .
148 .058 .034551310487673 -28 .023448687 .04240503 .0044923467 . .
149 .072 .05522791107947358 -27 .016772086 .035728425 -.0021842544 . .
150 .061 .03021003110048631 -26 .03078997 .04974631 .01183363 . .
151 .014 .02458818756050539 -25 -.010588187 .008368153 -.029544527 . .
152 -.032 -.01564904067504089 -24 -.01635096 .00260538 -.0353073 . .
153 -.061 -.052053237590925595 -23 -.008946763 .010009577 -.027903104 . .
154 -.081 -.056626591367589185 -22 -.02437341 -.005417068 -.04332975 . .
155 -.065 -.05579096203800852 -21 -.009209036 .009747304 -.028165376 . .
156 -.029 -.015110959990223357 -20 -.01388904 .005067301 -.032845378 . .
157 .005 .018364330945477073 -19 -.01336433 .00559201 -.03232067 . .
158 .039 .048064932763143435 -18 -.009064932 .009891408 -.02802127 . .
159 .083 .0652375579786505 -17 .01776244 .03671878 -.001193901 . .
160 .107 .09508236255941001 -16 .011917639 .03087398 -.007038702 . .
161 .075 .08155591535188053 -15 -.006555913 .012400428 -.02551225 . .
162 .076 .07635626750936071 -14 -.0003562699 .01860007 -.01931261 . .
163 .063 .06251976056101329 -13 .00048024044 .01943658 -.0184761 . .
164 .027 .028970539363514836 -12 -.0019705386 .016985802 -.02092688 . .
165 .015 .02340382577204157 -11 -.0084038265 .010552513 -.02736017 . .
166 -.001 -.003916841327409621 -10 .002916841 .02187318 -.016039498 . .
167 -.017 -.01890246061024844 -9 .0019024597 .0208588 -.01705388 . .
168 -.01 -.0029535192350807313 -8 -.00704648 .01190986 -.02600282 . .
169 .005 .019510285291108414 -7 -.014510285 .0044460553 -.033466626 . .
170 .028 .021010321626361947 -6 .006989679 .02594602 -.01196666 . .
171 .048 .0354591197649308 -5 .01254088 .03149722 -.00641546 . .
172 .041 .03319340708312716 -4 .007806594 .026762934 -.011149746 . .
173 -.009 .0012888359056058242 -3 -.010288836 .008667504 -.029245175 . .
174 .038 .027191119620280535 -2 .01080888 .02976522 -.00814746 . .
175 .047 .03716502169452651 -1 .009834977 .02879132 -.009121363 .04628639 .008373704
176 .077 .046892509636055804 0 .03010749 .04906383 .01115115 .05804366 -.002171322
177 .12 .06484274787688955 1 .05515725 .074113585 .036200907 .10104366 -.0092708375
178 .066 .04898249566777222 2 .017017504 .035973843 -.001938836 .05092133 .013008652
179 .079 .04840309443816042 3 .03059691 .04955325 .01164057 .06004366 -.0011501546
180 .062 .028815247592143177 4 .033184752 .05214109 .014228412 .04304366 -.023325846
181 .071 .029292901203524815 5 .0417071 .06066344 .02275076 .05204366 -.031370543
182 .081 .04175006287412836 6 .03924994 .05820628 .020293597 .06204366 -.016456217
183 .069 .03852560317014579 7 .030474395 .04943074 .011518055 .05004366 -.010905133
184 .09 .05440108867874319 8 .035598915 .05455526 .016642574 .07104366 -.00015416724
185 .062 .04437309312867823 9 .017626906 .036583245 -.0013294343 .04570253 .007789848
186 .064 .029259266194710663 10 .03474074 .05369708 .015784398 .04504366 -.024437813
187 .066 .009035411986202923 11 .05696459 .07592092 .03800825 .04704366 -.066885516
188 .055 .0020417076073179705 12 .05295829 .07191463 .03400195 .03604366 -.06987292
189 .062 .01739545860551904 13 .04460454 .06356088 .0256482 .04304366 -.04616542
190 .068 .022757695797859193 14 .04524231 .06419865 .02628597 .04904366 -.04144096
191 .069 .049217569293783486 15 .01978243 .03873877 .0008260894 .05004366 .0104788
192 .073 .05018953116164795 16 .02281047 .04176681 .003854128 .05404366 .008422724
end
format %tq time
tsset time, q
loc time_format: di r(tsfmt)
loc int_time = tq(2004q1)
loc intname "Reunification"
cls
tw ///
(line gd cf time, ///
lcol(black red) ///
lpat(solid shortdash) lwidth(medium medthin)), ///
legend(order(1 "Real Hong Kong" 2 "Synthetic Hong Kong")) ///
xli(`int_time', lcol("52 44 44") lpat(dash) lwidth(thin)) ///
note("Intervention happens at `time_format' `int_time'")

Comment