Hi, I am trying to illustrate some data in which I want to show the number of deaths per month across 22 periods ranging from July 2018 to May 2020. What I want to do is to have separate lines for each year but having the identification on the x-axis only for name of the months, making the lines stocked above/bellow each other, going from Jan-Dec. Now I have the time period ranging from January 2018 to May 2020. Does anybody know how I can solve it??
My code:
gen Deaths_2018 = 1 if inrange(timeperiod, 201807, 201812)
gen Deaths_2019 = 1 if inrange(timeperiod, 201901, 201912)
gen Deaths_2020 = 1 if inrange(timeperiod, 202001, 202005)
twoway (line death_per_month Dates if Deaths_2018==1) (line death_per_month Dates if Deaths_2019==1) (line death_per_month Dates if Deaths_2020==1)
This is the result so far.
Array
Best
David
Related Posts with Graph with several years.
esttab: report different standard errors (robust and non robust) into a single columnHello, I am estimating many regressions using different assumptions for standard errors. An example …
Setup data correctly for survival analysis - stset - without losing observationsDear all, i was hoping someone might be able to help me set up my data correctly so i can use it in …
Concatenation ignoring order and repeatsI have 6 categorical variables taking on one response per observation. These variables represent fie…
Concatenation ignoring order and repeatsI have 6 categorical variables taking on one response per observation. These variables represent fie…
Concatenation ignoring order and repeatsI have 6 categorical variables taking on one response per observation. These variables represent fie…
Subscribe to:
Post Comments (Atom)
0 Response to Graph with several years.
Post a Comment