Announcement

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

  • Kurtosis of three values always equals 1.5

    Dear Statalist,

    I got stuck with a surprising issue today when analyzing a dataset. I wanted to compute the kurtosis of the revenues of a company in the three years t0, t+1 and t+2. E.g. I wanted to compute a kurtosis value for the company Microsoft for the year 2000 -- which is based on Microsoft's sales values for the three years 2000, 2001 and 2002.

    However, the weird thing that happens is that the result for the kurtosis is always 1.5
    This is the case for all of the firms in my dataset, for all years

    I assume this could have something to do with the specific formula for computing the kurtosis which Stata uses?

    There appear to be different definitions and different ways how to compute the kurtosis. Would there by any alternative ways to compute the kurtosis? (So that the result is not always equal to 1.5)

    It seems to me that the answer to this calculation is not necessarily always equal to 1.5 -- but it is rather a result of the specific definition used by Stata?

    The current way I computed the kurtosis was as follows. If there would be any alternative suitable with regards to the above, this would be incredibly helpful.
    My current Stata code is:
    rangestat (kurtosis) firm_revenues, interval (Year 0 3) by(Company)

    Thank you so much & all the best,
    Franz

  • #2
    I wonder if there is a problem with your data such that the kurtosis really is 1.5 all the time, or if there is something else wrong. I say that because I cannot emulate your problem:

    Code:
    clear*
    webuse grunfeld
    
    rangestat (kurtosis) mvalue, by(company) interval(year 0 3)
    browse
    You can see that varying values of kurtosis are showing up, and I've checked a few of them by hand and they are correct.

    By the way, -interval (Year 0 3)- does not give you a three year window: it's a four year window extending from t through t+3 inclusive.

    Comment


    • #3
      Clyde Schechter

      But please try this with a range of 3 observations:

      Code:
      clear*
      webuse grunfeld
      
      rangestat (kurtosis) mvalue, by(company) interval(year 0 2)
      browse
      Red Owl
      Stata/IC 16.0 (Windows 10, 64-bit)

      Comment


      • #4
        Hmm, that's interesting.

        This is not coming directly out of -rangestat-. If you -summarize, detail- any three observations, it says kurtosis = 1.5 for that as well.

        But when I calculate kurtosis on several subsets of three observations by hand from the definition G = E(z4) (where z is the standardized value) it also always comes out 1.5. So I think this is correct. If I had the time I would try to algebraically prove that the kurtosis of any sample of size 3 is always 1.5. I'm pretty sure that's true.

        Comment


        • #5
          Thanks Clyde Schechter

          I had tried several examples manually with -summarize, detail- myself and got the same results. I just wanted to see if you thought this was a mistake or likely a correct result.

          Red Owl
          Stata/IC 16.0 (Windows 10, 64-bit)

          Comment


          • #6
            I didn't know this before reading the post, but it makes sense to me. If you think of a three point distribution, it is entirely determined by its first three moments. Therefore, fourth moments add no new information. It makes sense that a fourth moment of a standardized variable would be the same across distributions when the fourth moment is redundant. I would not have guessed the common value is 1.5, though.

            If you take any two point distribution, it is characterized by its first two moments. I believe the skewness -- based on the third central moment -- of all two-point distributions is zero.

            Comment


            • #7
              Thank you, Jeff Wooldridge. Your explanation is an elegant demonstration of the point! And, yes, you are quite right that the skewness of all two point distributions is zero. (In that case an algebraic proof is very simple, a one-liner really.)

              Comment


              • #8
                The skewness of all samples of size two is necessarily zero. Either the values are the same, or they are different: either way there can be no way that the sample carries information about asymmetry. More if more is needed at https://www.stata-journal.com/articl...article=st0204 (pdf is accessible).

                Looking at this paper will make kurtosis of 1.5 for a sample of 3 seem less surprising. There is no magic threshold for sample size that makes estimates of kurtosis useful and reliable, but if there were it would be >> 3.

                A reference missed in the paper cited above is https://projecteuclid.org/euclid.aoms/1177729602
                Last edited by Nick Cox; 10 Nov 2019, 01:13.

                Comment


                • #9

                  There appear to be different definitions and different ways how to compute the kurtosis. Would there by any alternative ways to compute the kurtosis? (So that the result is not always equal to 1.5)

                  It seems to me that the answer to this calculation is not necessarily always equal to 1.5 -- but it is rather a result of the specific definition used by Stata?
                  You should not be fixated by the number 1.5. You are correct, a number of other statistical packages (e.g., SAS, SPSS) use the formula below to calculate kurtosis, where a normally distributed variable has a kurtosis of 0.
                  Click image for larger version

Name:	G1.png
Views:	1
Size:	17.1 KB
ID:	1524105










                  Here, kurtosis is not defined for a sample of size less than 4 because the quantities labeled "a" and "c" will have 0s in the denominators. Stata uses the formula below, where a normally distributed variable has a kurtosis of 3.
                  Click image for larger version

Name:	G2.png
Views:	1
Size:	8.8 KB
ID:	1524106












                  So the magical number is 0.5, i.e., the sum of deviations to the fourth power about the mean divided by the square of the sum of squared deviations about the mean for a sample of 3 values is always equal to 0.5, i.e.,

                  $$ \frac{\sum_{i=1}^{3}\left(x_{i}- \bar{x}\right)^{4}}{\left[\sum_{i=1}^{3}\left(x_{i}- \bar{x}\right)^{2}\right]^{2}}= 0.5$$

                  where \(\bar{x}=(x_{1}+x_{2}+ x_{3})/3\).


                  In my methods classes, I always ask my students to try and replicate some of the statistics that Stata produces. I am able to find the code and using the census data set, here is the implementation of these two formulas.

                  Code:
                  sysuse census, clear
                  keep in 1/3
                  *First, store the number of observations as a scalar
                  qui sum pop
                  scalar n= r(N)
                  egen pop_m= mean(pop)
                  *Next, compute squared deviations from mean
                  gen deviation2= (pop-pop_m)^2
                  *Take the sum of the squared deviations
                  egen sum_deviation2 = sum(deviation2)
                  *Determine the standard deviation
                  gen sd_pop= ((1/(`=n'-1))*sum_deviation2)^0.5
                  *Compute the part labeled “a" in the formula
                  gen a= ((`=n')*(`=n'+1))/((`=n'-1)*(`=n'-2)*(`=n'-3))
                  *Compute the part labeled “c" in the formula
                  gen c= (3*(`=n'-1)^2)/((`=n'-2)*(`=n'-3))
                  *Compute the part labeled “b" in the formula
                  gen b1= ((pop- pop_m)/sd_pop)^4
                  egen b= sum(b1)
                  *Determine the value for Kurtosis based on formula
                  gen kurtosis1= (a*b)- c
                  *Use egen to generate Stata’s computation of kurtosis
                  egen kurtosis2= kurt(pop)
                  *Compare the two values
                  list kurtosis1 kurtosis2 in 1
                  
                  sysuse census, clear
                  keep in 1/3
                  *First, store the number of observations as a scalar
                  qui sum pop
                  scalar n= r(N)
                  egen pop_m= mean(pop)
                  *Next, compute squared deviations from mean
                  gen deviation2= (pop-pop_m)^2
                  *Take the sum of the squared deviations
                  egen sum_deviation2 = sum(deviation2)
                  *Next, compute deviations to the 4th power from mean
                  gen deviation4= (pop-pop_m)^4
                  *Take the sum of the deviations
                  egen sum_deviation4 = sum(deviation4)
                  gen kurtosis1= ((1/`=n')*sum_deviation4)/(((1/`=n')*sum_deviation2)^2)
                  *Use egen to generate Stata’s computation of kurtosis
                  egen kurtosis2= kurt(pop)
                  *Compare the two values
                  list kurtosis1 kurtosis2 in 1
                  Last edited by Andrew Musau; 10 Nov 2019, 11:28.

                  Comment


                  • #10
                    Andrew: I thought kurtosis has a lower bound of one. By Jensen’s inequality. Am I wrong about that? Is the .5 coming from a small sample adjustment?

                    Comment


                    • #11
                      @Jeff Wooldridge: I can't follow where Andrew Musau gets 0.5 either.

                      You are right about the lower bound of 1 given the formula that Stata uses. That limit is also discussed in my 2010 paper. A short proof could be based on Cauchy-Schwarz.

                      However, the bound is not attainable so far as I can see for 3 values. If 3 values are the same then the kurtosis is not determinate at all. If the 3 values are not all the same, e.g. are equally spaced or unequally spaced, I get 1.5 regardless in experiments, but I haven't proved it.

                      The lower bound of 1 is attainable if (and I conjecture only if) there is an even number of values and just two distinct values, so that half the values are equal to the minimum and half equal to the maximum.

                      Kurtosis is an odd beast!

                      The bottom line should be no surprise to anyone: there is not a lot of information in very small samples. They can't be a microcosm of their parent distribution.

                      Comment


                      • #12
                        Jeff Wooldridge & Nick Cox, you are both correct that the lower bound is 1 and the 0.5 value does not contradict this. Notice that I take away \(\frac{\frac{1}{n}}{\frac{1}{n^{2}}}\) from the Kurtosis formula because this is simply a constant. My point was to show that the variable part of the formula yields a constant value 0.5 independent of the values of \(x_{1}, x_{2}, \; \text{and}\; x_{3}\). That is

                        $$ \frac{\sum_{i=1}^{3}\left(x_{i}- \bar{x}\right)^{4}}{\left[\sum_{i=1}^{3}\left(x_{i}- \bar{x}\right)^{2}\right]^{2}}= 0.5$$

                        where \(\bar{x}=(x_{1}+x_{2}+ x_{3})/3\).

                        Now, \(\frac{\frac{1}{3}}{\frac{1}{3^{2}}} = 3\), and multiplying this with 0.5 results in kurtosis=1.5. The algebra needed to show the above is not very difficult, i.e., double the numerator minus the denominator is equal to 0. I will post this tomorrow when I get the time.

                        Comment


                        • #13
                          Yes, I overlooked you hadn’t divided by the sample size in the averages.

                          Comment


                          • #14
                            The algebra needed to show the above is not very difficult, i.e., double the numerator minus the denominator is equal to 0.
                            We have that

                            $$ \frac{\sum_{i=1}^{3}\left(x_{i}- \bar{x}\right)^{4}}{\left[\sum_{i=1}^{3}\left(x_{i}- \bar{x}\right)^{2}\right]^{2}}= 0.5\;\;\;\;\;\;\;\;\;\;\;\;(Eq. 1)$$

                            where \(\bar{x}=(x_{1}+x_{2}+ x_{3})/3\).


                            To show that Eq. 1 holds, one needs to show that


                            $$ 2\left[\sum_{i=1}^{3}\left(x_{i}- \bar{x}\right)^{4}\right]= \left[\sum_{i=1}^{3}\left(x_{i}- \bar{x}\right)^{2}\right]^{2}\;\;\;\;\;\;(Eq. 2)$$

                            This can be done directly, but the expression will be too long to follow. Instead, I will show that the right-hand side of Eq. 2 is equivalent to the left-hand side.

                            Click image for larger version

Name:	K1.png
Views:	1
Size:	46.6 KB
ID:	1524549

                            Click image for larger version

Name:	K2.png
Views:	1
Size:	42.6 KB
ID:	1524550

                            Comment


                            • #15
                              Thanks for posting the detailed argument. As a limiting case: when all the values are 0 your LHS and RHS are both 0 but kurtosis is also indeterminate, as pointed out in #11.

                              Comment

                              Working...
                              X