Announcement

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

  • In Stata 17.0 Kaplan-Meier graph with log scale in xaxis impossible due to start at zero, why?

    Hi, I have tried to start Kaplan-Meier plot with logscale at time -axis using several forms of stset commands or if-filters but time axis always start at zero so it means that values > 0 are usually at the right end and the plot looks awful. How to correct this?


  • #2
    By definition, survival times (failure times in general) are reckoned from zero--the moment that the entity under observation became at risk of failing. It is a category error to log transform a variable that takes on zero or negative values. You cannot "correct" this. You need a new plan.

    Why do you want to do this? There is probably some other approach that will achieve your underlying purpose without attempting to violate basic mathematics.

    Comment


    • #3
      Thanks for the answer.

      I think I tried enter-option in stset so that coming at risk happens not at zero but still there was zero at the graph. Xaxis started at zero. I must redo this to verify. Could it be that the plot still uses zero?

      Comment


      • #4
        When the risk started is not the issue as survival time could still be zero.

        As a purely graphical question it is often the case that, by default, axis labelling starts at zero, in which case xsc(log) has to be accompanied by an explicit xlabel()call specifying wanted positive values. But on the information given I don't endorse that as a good idea in this case.

        Comment


        • #5
          see sts graph options noorigin and tmin()

          Comment


          • #6
            If one has a counting process N and its compensator is at risk indicator x hazard , then if at risk is zero until some time, then until that time E(dN(t))=0, and because N >=0, this means at probability one (only a countable number of jumps) N(t)=0 until that time. So there is no event if the case is not at risk during some time after from zero with prob 1 = almost surely??? Sorry, I cannot understand how event time t can be zero if not not at risk???

            Comment


            • #7
              Here's an example using attained age as the timescale so the earliest observed entry time is 30.07 years.

              Code:
              webuse diet
              stset dox, origin(time dob) enter(time doe) id(id) scale(365.25) fail(fail==1 3 13)
              sts graph, tmin(30) xscale(log)
              A general approach is to use -sts list- with the saving() option followed by -graph twoway-.

              Comment


              • #8
                Nearly always it is assumed that there are no dirac measures at zero so that N(0)=0.

                Comment


                • #9
                  Thanks, Professor Dickman!

                  Comment


                  • #10
                    Originally posted by Jukka Ollgren View Post
                    Nearly always it is assumed that there are no dirac measures at zero so that N(0)=0.
                    Yes, I agree. In particular, Stata assumes N(0)=0. That is, Stata assumes there can be no events at time zero (see https://www.stata.com/support/faqs/s...and-cox-model/).

                    I'm not sure if I understand your argument, but you appear to be suggesting -sts graph- should not plot the value of S(t) at time zero. Why not. Doesn't N(0)=0 imply S(0)=1?

                    Comment

                    Working...
                    X