expanding the dataset is one common trick to include a total category, but you can also define a new variable if specifying the groups separately.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(caseid bmipct_y1 year anyuse) 1 55 1 0 1 57 2 0 1 60 3 0 2 57 1 1 2 65 2 1 2 80 3 1 2 81 5 1 2 81 6 1 3 54 1 2 3 40 3 2 3 45 5 2 3 50 7 2 end bys year: egen bmipct_ymean= mean(bmipct_y1) set scheme s1color twoway line bmipct_ymean year, sort|| line bmipct_y1 year if anyuse==0, sort || line bmipct_y1 year if anyuse==1, sort || line bmipct_y1 year if anyuse==2, sort gr save gr1, replace preserve expand 2, g(new) replace bmipct_y1= bmipct_ymean if new *CODE TOTAL CATEGORY =3 replace anyuse=3 if new twoway line bmipct_y1 year, sort by(anyuse) gr save gr2, replace gr combine gr1.gph gr2.gph restore
Comment