hello everyone
Somehow I could not get the desired results when using labmask in the following situation. I want to produce a graph with a formatted date axis (code 1 below). In my data my time variable is not directly the date variable but group of dates (to take out the gaps between some dates). Just wondering if there is a way to show a formatted date axis with the grouped date variable. I tried with code 2 below with no success. Grateful for any help.
Somehow I could not get the desired results when using labmask in the following situation. I want to produce a graph with a formatted date axis (code 1 below). In my data my time variable is not directly the date variable but group of dates (to take out the gaps between some dates). Just wondering if there is a way to show a formatted date axis with the grouped date variable. I tried with code 2 below with no success. Grateful for any help.
Code:
*CODE 1 clear set obs 10 gen date=20000+_n*2 //dates with gaps gen x=_n tsset date tsline x , tlabel(, format(%dm-CY)) ************* *CODE 2 clear set obs 10 gen date=20000+_n*2 //dates with gaps egen day=group(date) gen x=_n tsset day g sdate=string(date,"%dm-CY") labmask day, values(sdate) tsline x
Comment