Announcement

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

  • How to winsorize with specific conditions?

    Hi members

    I am just wondering how to code the following in stata :how to winsorize total asset at the $4.5 billion, and firm age at 37 years?

    thank you .

  • #2

    Code:
    gen totalasset2 = min(4.5e9, totalasset) if totalasset < .
    may be suggestive. (This isn't Winsorizing!)

    Comment


    • #3
      Dear Nick
      Thanks for your kind help. I am following a paper and here is the context of it as it may give a clear picture of what I need:
      "Financial constraints index proposed by Hadlock and Pierce [2010]. It is calculated as (−0.737 × Size) + (0.043 × Size2) − (0.040 × Age). Size is the natural logarithm of inflation-adjusted book assets. Age is the number of years a firm is listed with a non-missing stock price on Compustat. Following Hadlock and Pierce [2010], book asset is winsorized at the $4.5 billion, and age is winsorized at 37 years. Higher values of all three indices indicate more financial constrained".

      Thanks in advance for your kind support.








      Comment


      • #4
        It is not Winsorizing as I understand it to be usually defined, which is pulling in to a fraction or count of values
        in one or both tails. I would call it topcoding.

        But other people use the language too.

        I don’t know what to make of a quotation without a reference.

        More important, I gave you code already, and the principle for the second variable is the same as for the first.
        Last edited by Nick Cox; 30 Oct 2023, 17:58.

        Comment


        • #5
          Thanks, Nick. the code worked well as wanted so thank you again.

          Comment

          Working...
          X