Announcement

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

  • Winsorization of variables using winsor2

    I winsorized 25 variables simultaneously using the winsor2 command in Stata. However, I noticed that the first variable in the variable list does not appear to have been winsorized correctly and contains some unusual values after running the command. In contrast, the remaining variables appear to have been winsorized as expected.

    Is this a known issue with winsor2, or could it be related to the way the command is specified? Has anyone encountered a situation where the first variable in a winsor2 command is treated differently from the others?

    Any guidance on how to diagnose or resolve this issue would be greatly appreciated.

  • #2
    If you haven't set any options, then winsor2 will just look at the value of that variable for the top 1% and any observation above that value is truncated to that value, and it does the same for the bottom 1%. That 1% if obviously completely arbitrary. There is no guarantee that that will capture all values you would classify as "unusual".

    The solution is to inspect each unusual value by hand.
    • Some values are unusual but plausible. You do not want to change those, but you may want to change your model to better accommodate those
    • Others have some obvious errors, like -98 which is probably a missing value code one forgot to set to missing, or if a respondent claims to be a 185 meters tall, then they probably switched meters and centimeters. Those errors you can and should fix
    • Others don't have an obvious fix. In that case you don't know what the value is, and the way we deal with that is setting them to missing.
    In none of these cases Winsorize does what needs to be done. This is obviously much more time consuming, but that is the way it is. When creating a time budget for the data analysis part of a project, a good rule of thumb is that 90% of your time is going to data preparation, 1% to estimating models (probably less), and 9% on interpreting the results and creating tables and graphs.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Similar sceptical if not critical comments on Winsorizing have often been made in this forum. See for example the recent thread https://www.statalist.org/forums/for...inancial-firms

      The specific question about winsor2 remains, which is hard to discuss without concrete evidence. You could show the data for the first variable. Or you could experiment with the order of input to check whether being first in a supplied list is problematic as such.
      Last edited by Nick Cox; 30 Sep 2026, 00:50.

      Comment

      Working...
      X