This is a survival analysis dataset. I want to add two separate cumulative failure graphs together with necessary legends by gender to distinguish them in the resulting graph.
webuse catheter, clear
stset time infect
sts gen s = s
gen cumulative_failure = 1 - s
sort _t
label var cumulative_failure "Cumulative Failure Probability"
tw(line cumulative_failure time if female==1)
tw(line cumulative_failure time if female==0)
I know that the goal can be done if using
tw(line cumulative_failure time if female==1)(line cumulative_failure time if female==0) . I don't want this.
Also, I don't want to use
ltable time infect, failure graph by(female) notable
because it just generates two separate plots although they are in a same plane.
Thank you for your help!
webuse catheter, clear
stset time infect
sts gen s = s
gen cumulative_failure = 1 - s
sort _t
label var cumulative_failure "Cumulative Failure Probability"
tw(line cumulative_failure time if female==1)
tw(line cumulative_failure time if female==0)
I know that the goal can be done if using
tw(line cumulative_failure time if female==1)(line cumulative_failure time if female==0) . I don't want this.
Also, I don't want to use
ltable time infect, failure graph by(female) notable
because it just generates two separate plots although they are in a same plane.
Thank you for your help!
Comment