Announcement

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

  • force negative time values in sts graph x-axis

    hello, as explained in another thread, I am doing a survival analysis concerned with a setting in which time is best described as t-12, t-11, t-10.. (up to t=0 if the subject is right-censored).

    setting the dataset using stset, I automatically get _t=0...._t=12. the command does not allow for negative values in the timevar.

    When I use the command sts graph, the x-axis is accordingly labelled from _t=0 - _t=12. However, I want to substract 12 from the number in the labels because this way of referring to points in time is important for the storytelling in the paper.

    can anyone help me with this? xlabel(-12 -11...) simply expands my graph with empty space on the left half of the graph and things such was xlabel(-12=0 -11=1...) do not seem to exist. Can I overrule the standard labelling for this built-in kind of graph that only works with positive time values?

    many thanks!

  • #2
    I can't see a cross-reference to the other thread you're alluding to.

    If I understand this correctly, you don't need to force anything. You just want to see an axis labelled in terms that make sense for your problem.

    If so, then http://www.statalist.org/forums/foru...-actual-values applies

    which in turn references http://www.stata-journal.com/sjpdf.h...iclenum=gr0032 and mylabels (SSC).

    Code:
    mylabels -12(1)0, myscale(@ + 12) local(labels)
    will define a local macro which can be used, but nothing stops a direct approach, e.g. an expansion of

    Code:
    ... , xla(0 "-12" 1 "-11")

    Comment


    • #3
      thank you very much Nick, this was very quick and helpful

      Comment

      Working...
      X