Announcement

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

  • Code for dividing variables by two times their standard deviation

    Hello,
    I hope everyone is well. I'd like to divide variables by two times their standard deviation and was wondering what the code was? Best and thanks,
    Tom

  • #2
    Code:
    foreach var in x y z{
        qui sum `var'
        gen wanted_`var'= `var'/(2*r(sd))
    }

    Comment


    • #3
      Thanks so much Andrew :-)

      Comment

      Working...
      X