Dear all
Can someone please help me to create a time-series graph. I want to display percentage/proportions per month of people died in my data over the last two years. I can simple crosstab and see what proportions per month something like this below,
bysort year: tab month died,col row
However, I believe I need to generate a separate variable which I can use in the time-series graph display my proportions, I am not able to do that, I have used below command
by month, sort: egen pcdied = mean(100 * died)
However, this seems to be generating different values compared to what I can see from my cross tabs and the difference is quite significant
I need these percentages so I can do the following
tsset time
two (tsline pcdied month)
Apologise for a daft question on this forum, I am not sharing the data here because I think its quite a simple function which I not able to do myself. However, if a data example is required I can share the dataex.
Can someone please help me to create a time-series graph. I want to display percentage/proportions per month of people died in my data over the last two years. I can simple crosstab and see what proportions per month something like this below,
bysort year: tab month died,col row
However, I believe I need to generate a separate variable which I can use in the time-series graph display my proportions, I am not able to do that, I have used below command
by month, sort: egen pcdied = mean(100 * died)
However, this seems to be generating different values compared to what I can see from my cross tabs and the difference is quite significant
I need these percentages so I can do the following
tsset time
two (tsline pcdied month)
Apologise for a daft question on this forum, I am not sharing the data here because I think its quite a simple function which I not able to do myself. However, if a data example is required I can share the dataex.
Comment