Hi,
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
When I type a code for the KM curve. using
HTML Code:
sts graph, by(age65) f tmax(1460) title("") xtitle("Days") ytitle("Cumulative incidence")
The graph comes out all right but with the automatic legend that age65=0 and age65=1 with the lines
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")
I get the following error:
HTML Code:
legend.labels[0] invalid name
Any idea as to how to get the legend going without this error? Thanks a lot.