Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: yscale/range to plot

From   Nita Forouhi <>
To   "''" <>
Subject   st: RE: RE: yscale/range to plot
Date   Mon, 7 Mar 2005 13:09:46 -0000

Dear David and Nick (and others)

That was very helpful about the yla command to specifiy the y-scale. 

I forgot to ask, is there any way in which I can ask STATA to insert a line
or two lines (such as //) on the y-axis, to show that I have re-scaled the
graph - ie i have gone for a changed axis such that it starts at 0.8 rather
than at 0- so the reader knows straightaway that the axis was modified.

Many thanks


-----Original Message-----
From: David Harrison []
Sent: 07 March 2005 12:38
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.

sysuse cancer
stset studytime, f(died)
sts graph
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 []
Sent: 07 March 2005 12:20
To: ''
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:

*   For searches and help try:
*   For searches and help try:

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