[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: RE: yscale/range to plot
You can also make -sts graph- automatically scale the y-axis to show just the range covering your Kaplan-Meir curve with the command:
sts graph, ylabel(minmax)
If you would then like to adjust the scale, you can add the suffix ...yscale(range(0.8 1)).
But you still can't use -yscale- on its own; it must follow -ylabel(minmax)-.
I couldn't find information on -ylabel(minmax)- in Stata help, but it has been previously mentioned in StataList - I had exactly the same problem last year.
Dr Angus Campbell
The Mackinnon Project
Faculty of Veterinary Science, University of Melbourne
250 Princes Highway
Werribee, Vic, 3030
>Date: Mon, 7 Mar 2005 12:37:59 -0000
>From: "David Harrison" <firstname.lastname@example.org>
>Subject: st: RE: yscale/range to plot
>The -range()- option will never reduce the range of the axis, only expand it (see help axis_scale_options).
>In the case of -sts graph-, if your Kaplan-Meier curves do not go below .8 then you may be able to get the behaviour you want by changing the -ylabel()- option, e.g.
>stset studytime, f(died)
>sts graph, yla(.25(.25)1)
>If you want to restrict the range so that some of the curve is not visible, you will need to use -sts gen- to generate the full curve and then plot only the bit you want using a standard twoway graph.
>Hope this helps,
>- -----Original Message-----
>From: Nita Forouhi [mailto:email@example.com]
>Sent: 07 March 2005 12:20
>Subject: st: yscale/range to plot
>Would anyone know how to re-set the y axis on a Kaplan Meir curve, so the
>survival probability starts at say 0.8 instead of at 0?
>I tried the command (below) but nothing visibly happened that was different
>- - ie the graph for sts graph, by(xvar) looked the same, ie started at 0 for
>y axis, as when i tried the yscale and range commands as below
>sts graph, by(xvar) ysc(r(0.8 1.0))
>(and when i tried it in a standard y vs x twoway scatter graph, nothing
>happened to the y-scale either - eg
>twoway scatter y x, ysc(r(15 50)) where y might be something like BMI say,
>and I only wanted to plot BMI on y axis from 15 to 50 say)
>Most grateful for any pointers on re-setting the scale/range to plot.
* For searches and help try: