Announcement

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

  • How does winsorize2 treat missing values in the main variable and by option?

    Lets say I was to run
    Code:
    winsor2 variable1 variable2, cut(0 98) by(Sex)
    Sex takes only 0,1 or missing value. And I have several observations where variable1 and/or variable2 and/or Sex was missing.
    I know that winsor2 will divide the dataset into two(or is it three?) parts depending on the value of Sex being 0 or 1 (or missing as well?) And then variable1 will be winsorized for the 2/3 dataset so will variable2 be. But will the missing value within variable1 and variable 2 be taken as 0 or will those observations be completely excluded when winsorize2 looks at the distribution?
    I want a way such that the winsorize2 command can exclude the observations where there is a missing value for the variable in by(). Can someone advice?

  • #2
    winsor2 (not winsorize2) is from SSC. I am not the author. I wrote winsor from SSC, which as the names imply is similar but not identical.

    winsorize2 ignores missing values on the variables being Winsorized. (Why would it treat them as 0?)

    it does not ignore missing values on the by() variable. They are just distinct.

    Comment

    Working...
    X