Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: How to overlay four Cox survival curves in one graph

From   Nick Cox <>
To   "" <>
Subject   Re: st: RE: How to overlay four Cox survival curves in one graph
Date   Thu, 18 Apr 2013 11:04:47 +0100

This should work too, in the same example.

line basesurvest* _t, connect(J ..) sort legend(order(1 "1" 2 "2" 3 "3"))


On 18 April 2013 10:58, Tim Evans <> wrote:

> Can you run -stcox- with and estimate the basesurv. You should then be able to construct your survival curves in one graph using something like this:
> forval i = 1/3 {
> stcox if whatever==`i', estimate basesurv(basesurvest`i')
> }
> line basesurvest1 _t, connect(J) sort || /*
> */ line basesurvest2 _t, connect(J) sort || /*
> */ line basesurvest3 _t, connect(J) sort

agnes cheah

> I have plotted two separate Cox survival curves (corresponding to two Cox models). How do I overlay the two plots (containing 2 curves, because stcurve, by variable command used) into one single graph)? I tried graph combine (not what I want) and addplot (does not seem to work).

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index