Announcement

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

  • #16
    Originally posted by Joro Kolev View Post
    Also I do not think that this option is of any particular grand use. It is just a convenience command, as

    Code:
    _pctile price, nq(5)
    is equivalent to

    Code:
    _pctile price, _pctile price, percentiles(20 40 60 80)
    Yes, of course. That's why -egen-xtile- created the option -percentiles- from the -nq()- user input. However, the method used fails in the sense that it is not identical to the result of -xtile- when using it for the following very specific situation:

    Code:
    sysuse auto, clear
    expand 100
    
    
    egen x = xtile(mpg), nq(74)
    
    xtile y=mpg, nq(74)
    capture assert x==y
    Therefore I want to parse the users' nq-option to _pctile directly. But I cannot test this on Stata < 15 ...

    Comment


    • #17
      Originally posted by Ulrich Kohler View Post
      As far as I know, new features do still work under version control. Try out

      . sysuse auto
      . version 1.0
      . npregress kernel mpg weight

      I am pretty sure that non parametric kernel regression was not available in Stata 1.0
      You are most probably right... On second thought I have always used Version control to make old commands work. (And not to make new commands not work. So probably what I did above is not the intended uses of Version control...)

      In any case, I dug out the Reference manual for Stata 7, and the - _pctile varname, nq(number) - is documented there. So the option exists at least since and including Stata 7.

      I do not think that you should dig any further in the prehistorical past. Even I do not use Stata 7 anymore

      Comment


      • #18
        Originally posted by Joro Kolev View Post

        You are most probably right... On second thought I have always used Version control to make old commands work. (And not to make new commands not work. So probably what I did above is not the intended uses of Version control...)

        In any case, I dug out the Reference manual for Stata 7, and the - _pctile varname, nq(number) - is documented there. So the option exists at least since and including Stata 7.

        I do not think that you should dig any further in the prehistorical past. Even I do not use Stata 7 anymore
        Ah, thanks a lot. So I keep -version 8.2- just as it was, so that old do-files continue to run with the new version.

        Comment


        • #19
          Version control is not a time machine. There aren't old Statas wrapped in your new(ish) Stata. Version control just does what is documented: restore old behaviour in particular respects documented. But to be fair: it's hard to explain what version control does do (and does not do). I thought it could be explained in about a paragraph until I tried it. https://www.stata.com/support/faqs/p...stata-version/

          That homily aside, _pctile was introduced in Stata 5 with the nquantiles() option too.

          Comment


          • #20
            Code:
            help whatsnew8
            is the earliest mentioning of _pctile (from Stata 6 on). For version 8.1 the following is listed

            14. _pctile will now compute up to 1000 percentiles (previously the limit was 20); see
            help _pctile. In addition, pctile (no underscore) takes advantage of _pctile's new
            higher limit, and is more precise in determining the boundaries between the
            requested percentiles.
            Best
            Daniel

            Comment


            • #21
              Originally posted by daniel klein View Post
              Code:
              help whatsnew8
              is the earliest mentioning of _pctile (from Stata 6 on). For version 8.1 the following is listed



              Best
              Daniel
              Indeed, the fact that -_pctile, nq(num)- could calculate only up to 21 quantiles in Stata 7 is explained in the second paragraph of the Reference manual for Stata 7 too.

              "_pctile is, however, limited to compting 21 quantiles since there are only 20 r()s to hold the results" p.497.

              Comment

              Working...
              X