Announcement

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

  • 5 year Moving Averages

    How can i calculate 5 year moving average of any country's GDP?

  • #2
    I would incline to a moving geometric mean in this case; otherwise

    Code:
    help tssmooth

    Comment


    • #3
      i am using this command and this is the error that is occurring:

      . tssmooth ma GDPAvg = GDP , window(2 1 2)

      Error:
      window() invalid -- invalid numlist has elements outside of allowed range
      r(125);

      How can i resolve this?

      Comment


      • #4
        You can also explore asrol that has gmean function for finding a rolling window geometric mean.
        Code:
        ssc install asrol
        help asrol
        webuse grunfeld
        bys company: asrol invest, stat(gmean) win(year 10)
        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


        • #5
          Syntax looks good to me,

          Comment

          Working...
          X