Hi all,
I have a variable, "tx_order" with contains 7 categories of a treatment. A second category "YEAR_OF_DIAGNOSIS" indicated the year administered.
I'm trying to plot the percentage of each category per year in a line graph. Where I have a line for each category depicting the percentages - see below. For example, in 2004 "Surgery" would be 34.55%, "Radiation" 0%, etc.
Tabulation:
I created these graphs with binary variables, using the code below. However, I don't know how to do it for a non-binary variable, like the one described above.
tab chemo YEAR_OF_DIAGNOSIS, col
by YEAR_OF_DIAGNOSIS, sort: egen pc_chemo = mean(100*chemo)
label variable pc_chemo "Chemotherapy"
*Graph
twoway (connected pc_chemo YEAR_OF_DIAGNOSIS), ///
xtitle(Year) xlabel(#14) ///
ytitle(Received Radiation (%)) ylabel (0(10)100)
I would really appreciate your help!
Comment