Announcement

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

  • winsor: generate() should give new variable name

    Dear:

    I met another programming problems. Please read the following:

    sum bankloan privateloan

    Variable | Obs Mean Std. Dev. Min Max
    -------------+--------------------------------------------------------
    bankloan | 1218 3.82e-09 2.29e-08 0 1.95e-07
    privateloan | 1204 2.47e-09 1.40e-08 0 1.19e-07


    winsor bankloan, gen(bank_w) p(0.05) high
    generate() should give new variable name
    r(110);


    end of do-file

    r(110);

    Actually, the bank_w is a new variable name I attached to the bankloan after it is winsored. I do not know why it still shows like this.

    Best,

    Eddie

  • #2
    Can you check this directly through

    Code:
    confirm new variable bank_w 

    Comment


    • #3
      I'm guessing that you've invoked the same command twice without dropping the newly created variable in between invocations.

      .ÿ
      .ÿversionÿ15.1

      .ÿ
      .ÿclearÿ*

      .ÿ
      .ÿsetÿseedÿ`=strreverse("1446929")'

      .ÿquietlyÿsetÿobsÿ1218

      .ÿ
      .ÿgenerateÿfloatÿbankloanÿ=ÿrnormal(3.82e-09,ÿsqrt(2.29e-08))

      .ÿquietlyÿreplaceÿbankloanÿ=ÿmax(bankloan,ÿ0)

      .ÿquietlyÿreplaceÿbankloanÿ=ÿmin(bankloan,ÿ1.95e-07)

      .ÿ
      .ÿwinsorÿbankloan,ÿgenerate(bank_w)ÿp(0.05)ÿhigh

      .ÿ
      .ÿcaptureÿnoisilyÿwinsorÿbankloan,ÿgen(bank_w)ÿp(0.05)ÿhigh
      generate()ÿshouldÿgiveÿnewÿvariableÿname

      .ÿ
      .ÿ*
      .ÿ*ÿSolution
      .ÿ*
      .ÿdropÿbank_w

      .ÿ
      .ÿwinsorÿbankloan,ÿgenerate(bank_w)ÿp(0.05)ÿhigh

      .ÿ
      .ÿexit

      endÿofÿdo-file


      .

      Comment


      • #4
        Joseph: I think that's a good guess.

        Comment

        Working...
        X