Announcement

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

  • rolling geometric mean

    Hi,

    Is there a simple way to calculate rolling geometric means, for example 10 year window? Can I use rangestat to do this?

    thanks

  • #2
    That's embedded in the next version of rangestat (from SSC, as you are asked to explain) and is programmable in the current version. But I am going to guess that you really want to work with geometric mean returns, not at all the same thing.

    [geometric mean of 1 + return] - 1

    which again is programmable, but you may find it easier to use asrol (also SSC).

    Comment


    • #3
      Nick Cox thanks for referring asrol here. Here is one example of asrol for getting geometric mean:
      Code:
      ssc install asrol
      webuse grunfeld
       
      * Geometric mean in a rolling window of 10 years for each company
      bys company: asrol invest, stat(gmean) win(year 10)
      For more examples, you can type
      Code:
      help asrol
      Regards
      --------------------------------------------------
      Attaullah Shah, PhD.
      Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
      FinTechProfessor.com
      https://asdocx.com
      Check out my asdoc program, which sends outputs to MS Word.
      For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

      Comment


      • #4
        Note that geometric mean means one thing in classical statistics and (often) something related but not identical when applied to finance data.

        Comment

        Working...
        X