Announcement

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

  • Winsor2 Warning

    Hi all,

    I ve come across this warning ....and I don't know how to force data to execute the command rather than repeatedly showing me the warning
    I am using winsor2 with 0.5th percentile and 99.5 percentile. pls see attached the warning.

    Would be great if you tell me how to execute the command either way


    . winsor2 stock_return , cuts(.5 99.5) replace
    Warning: cuts(1 99) means winsor at 1th percentile and 99th percentile,
    cuts(0.1 90) means winsor at 0.1th percentile and 90th percentile,
    make sure cuts(.5 99.5) you specified is what you want.

    Last edited by Dustin Miller; 23 Apr 2015, 11:14.

  • #2
    winsor2 is from SSC, as you are asked to explain (FAQ Advice Section 12).

    I have never used it, but I'll guess that you could suppress the warnings by just calling it quietly

    Code:
    quietly winsor2 stock_return , cuts(.5 99.5) replace

    Comment


    • #3
      Hi Nick,

      quietly surpressed the warnings, though did not change anything.
      It is pretty weird since for cuts(1 99) or cuts(5 95) winsor2 works as it should

      Comment


      • #4
        You seem to be implying that there is a still a problem, but I don't know what it is.

        Comment


        • #5
          The data is still not winsorized

          Comment


          • #6
            You could give us a reproducible example, or contact the program author, or both.

            Comment


            • #7
              Dustin Miller Out of curiosity, I installed winsor2 and tested it on 200 random uniform numbers, using your syntax, and it did replace two values with new values. Depending on the number of observations you have, and the distribution of the values, it could be the case that nothing could be done. I tested winsor2 on 200 observations, of which 100 were .1 and 100 were .9, and nothing was done.

              I applied the winsor command (also from SSC) to the same data and received the same results, so if you're not seeing any changes, I'd say it's a feature rather than a bug.
              Code:
              . clear
              
              . set obs 200
              obs was 0, now 200
              
              . set seed 42
              
              . gen double x = runiform()
              
              . clonevar xsave = x
              
              . gen double y = .1
              
              . replace y = .9 in 101/200
              (100 real changes made)
              
              . clonevar ysave = y
              
              . winsor2 x y, cuts(.5 99.5) replace
              Warning: cuts(1   99) means winsor at   1th percentile and 99th percentile,
                       cuts(0.1 90) means winsor at 0.1th percentile and 90th percentile,
                       make sure cuts(.5 99.5) you specified is what you want. 
              
              . list x xsave if x != xsave
              
                   +-----------------------+
                   |         x       xsave |
                   |-----------------------|
              138. | .00992936    .0013312 |
              195. |  .9960617   .99643323 |
                   +-----------------------+
              
              . list y ysave if y != ysave
              
              .

              Comment


              • #8
                William just mentioned winsor, which is mine. winsor2 was written by Lian Yujun. It acknowledges some use of my code, which is fine by me, but I wasn't and am not involved with its development or support.

                Comment


                • #9
                  Hi William and Nick,

                  it seems as if its due to the distribution of values. winsorizing works if I apply cuts such as 5 and 95.
                  Do you have any other suggestions in mind how I could clean the data from outliers except of just eliminating them?

                  best,
                  dm

                  Comment


                  • #10
                    I rerun the winsorizing with winsor and it does work with winsor! my particular problem is that I would need to run winsor with a by() command

                    Comment


                    • #11
                      My top strategies are using logarithms or some other nonlinear, using quantile regression, and using robust regression.

                      I never eliminate outliers unless there is independent evidence that a measurement is qualitatively incorrect.

                      Comment

                      Working...
                      X