Announcement

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

  • distplot and right-censoring

    The -distplot- command written by Nick Cox has become my default for picturing cumulative distributions.
    Code:
    search distplot
    But does anyone know if it's possible with -distplot- to censor the CDF? An example would be where the data have a long right tail so that most of the graph is depicting the CDF near 1. In this case a clearer picture might emerge if the graph could be censored at some not-so-large value of the data, much like many familiar pictures of Kaplan-Meier curves in clinical studies involving, say, administrative censoring.

    The desired picture could be obtained by using the -cumul- command, e.g.
    Code:
    sysuse auto
    
    sort price
    cumul price, g(cprice)
    
    tw scatter cprice price if price<10000, s(i) c(l) ylab(0(.2)1)
    But using -distplot- would be preferable.

    Note that using "if price<10000" with -distplot- does not provide the desired result.

    It may be that this is not currently a feature of -distplot- but if anyone knows differently I'd be grateful to know. Thanks in advance.

  • #2
    Correct. distplot does not support thiis at present.

    Comment


    • #3
      I did this and it worked, at least in the visual presentation. Or I suppose you could preserve, drop>10000, and then do it.
      Code:
      distplot price
      distplot price if price<10000

      Comment

      Working...
      X