Hi, I am trying to create a series of Kaplan-Meier survival curves based on a series of categorical variables. Each variable's values have labels assigned to them. Accordingly, when I run the code below
I obtain a graph like this
How could I go about removing the "olc = " in the legend? I know that I can use legend(lab(1 "Group A") lab(2 "Group B") lab(3 "Group C")) but each of the variables in my loop do not have the same value labels. Accordingly that solution would not work for me. Is there a better way to get what I want rather than run separate lines of code each of the graphs?
Code:
local rvar olc omc ouc dlc dmc duc foreach i of local rvar { sts graph, by(`i') }
How could I go about removing the "olc = " in the legend? I know that I can use legend(lab(1 "Group A") lab(2 "Group B") lab(3 "Group C")) but each of the variables in my loop do not have the same value labels. Accordingly that solution would not work for me. Is there a better way to get what I want rather than run separate lines of code each of the graphs?
Comment