I am trying to create Kaplan-Meier curves and trying to see the difference according to age category. The age category is a binary variable coded 0 and 1.
HTML Code:
tab age65 age65 0 17,312 1 15,148 Total 32,460
HTML Code:
sts graph, by(age65) f tmax(1460) title("") xtitle("Days") ytitle("Cumulative incidence")
Array
I want a legend with some better labels instead of just the variable names. So I used legend(lab) command. However when I type :
HTML Code:
sts graph, by(age65) f tmax(1460) legend (lab (0 "Age less than 65 years") lab (1 "Age more than 65 years"))title("") xtitle("Days") ytitle("Cumulative incidence")
HTML Code:
legend.labels[0] invalid name
0 Response to Error while trying to add legend to a KM plot.
Post a Comment