Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom STS graph axis with spacing

    Hi,

    This is my first post on STATALIST

    I am trying to create a custom y axis scale using Sts graph for a Kaplein Meir.

    Essentially on the y axis I want to label (min) 0, 0.001, 0.01, 0.1 (max) - but have these equally spaced out on the axis

    Any help will be gratefully received

    Many thanks

  • #2
    As the range of the y-axis is the unit interval, 4 equally spaced points imply

    \(\text{(0, 0.001, 0.01, 0.1)} \rightarrow \text{(0}, \frac{1}{3}, \frac{2}{3}, \text{1).}\)

    Therefore, just label these points with your values.

    Code:
    webuse drug2
    sts graph, by(drug) scheme(s1color) ylab(0 "0" `=1/3' "0.001" `=2/3' "0.01" 1 "0.1")
    Res.:
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	45.4 KB
ID:	1579781

    Comment


    • #3
      Sorry perhaps I haven't made myself clear.

      I have used sts graph, failure. But my event of interest is very rare (in a dataset of 900,000)

      Therefore I want to plot it on a custom y scale 0,0.001,0.01,0.1. (essentially to exactly how you have labelled the y axis - but at present you've just replaced the labels with them values on the same scale)

      Many thanks

      Comment


      • #4
        I do not follow. The original scale is 0-1, so either you want to exclude part of the graph or you want to apply a transformation. If the latter, for a linear transformation, divide by 10. But you won't have equally spaced values (0, 0.001, 0.01, 0.1). If it is a non-linear transformation, then define it.

        Comment


        • #5
          OK - that makes sense - thanks very much

          Comment


          • #6
            I don't follow what is wanted here. It seems as if you want to show zero on an otherwise logarithmic scale.

            Comment

            Working...
            X