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.
stpm2 r(1400) - initial values not feasibleHello everyone! I'm working on a predictive flexible parametric survival model and when I run the c…
Prompt for values interactively in do fileDear Statalist, Is there any way to prompt for local variable with pattern i.e. numeric only/alpha …
stpm2, initial values not feasibleHello, I am trying to run a flexible Parametric model in Stata. I study various outcomes and I run …
WLS = reg + aweights?I would like to understand whether I apply the regression technique "weighted least squares (WLS)" b…
Multivariate tobit modelHi, I am trying to run a multivariate tobit model using lots of dummy independent variables for my …
Subscribe to:
Post Comments (Atom)
0 Response to Graph with several years.
Post a Comment