Announcement

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

  • Median standard deviation

    Hey everybody,

    I have to calculate the median standard deviation of monthy returns of a fund.

    I looked up on wikipedia the defintion of median standard deviation.

    Is there an easy function in stata to calculate it? I didn't find any hints in the internet.


    Best wishes
    Bene

  • #2
    check out -egen mdev-

    Code:
    *=======LONG WAY
    egen median=median(x)
    gen absdev=abs(median-x)
    egen MAD1=total(absdev)
    replace MAD1=MAD1/_N
    
    *=======SHORT WAY
    egen MAD=mdev(x)
    Last edited by ben earnhart; 31 Oct 2015, 17:08.

    Comment


    • #3
      Ben: Your recipes are for different quantities. Below I refer to egen functions.

      mdev() calculates the mean absolute deviation from the mean.

      Your longer recipe calculates the mean absolute deviation from the median. You could shorten it and protect against missing values by using mean() instead of your last two lines. I don't think it's commonly used.

      There is often good reason to use the median absolute deviation from the median, mad().

      Occasionally two or more of these might coincide numerically.

      I see no reason to call any of these the median standard deviation, an expression I have not heard before.

      Bene Eil: Please show us your reference.

      Comment


      • #4
        Thank you for your advices.

        I have read it in a paper of my professor that I need for my master thesis. Kempf, Ruenzi (2008): Tournaments in Mutual-Fund Families. You can find it with google scholar.

        I only found the wikipedia article about the median absolute deviation.

        That why, I'm a little bit confused...

        Comment


        • #5
          I think the onus is on you to provide adequate references. If you can give a formula or algorithm, someone may want to give you code.

          Comment


          • #6
            A median SD might be something like this: you calculate SDs at one scale level and then summarize a bunch of them at another scale level by taking their median. That could be just egen calls in succession.

            But that's pure speculation on my part, absent any specific details here beyond the name.

            Comment


            • #7
              I will ask my professor tomorrow and let you know...

              Comment

              Working...
              X