Announcement

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

  • Amplitude and Duration of Business Cycles

    Dear all,

    I used the intuition in the Bry and Boschan (1971) algorithm to generate business cycle turning points for my dataset.
    Therefore, I used real GDP per capita ("rgdpmad").
    The new variable "rgdpmad_point" equals 1 if real GDP is a local maximum (=peak) and -1 if it´s a local minimum (=trough).
    This means that recessions refer to the period between 1 and -1 and expansions refer to the period between -1 and 1.

    You can see part of my data above.

    Now I would like to compute the following variables:
    duration, as the length from start to end of the expansion / recession phase (in years)
    amplitude, as the average change in output per capita between the turning points

    Unfortunately, I have no idea how to compute these two characteristics.
    Maybe someone could help?

    Thank you very much in advance!


    year country rgdpmad rgdpmad_point
    1870 Australia 3273.2394 0
    1871 Australia 3298.5075 0
    1872 Australia 3553.4262 0
    1873 Australia 3823.6292 0
    1874 Australia 3834.7969 0
    1875 Australia 4138.207 1
    1876 Australia 4007.2576 0
    1877 Australia 4036.0902 0
    1878 Australia 4277.4006 0
    1879 Australia 4204.9835 0
    1880 Australia 4285.3892 0
    1881 Australia 4454.8259 0
    1882 Australia 4062.6065 -1
    1883 Australia 4475.2758 0
    1884 Australia 4303.5994 0
    1885 Australia 4422.2642 0
    1886 Australia 4329.4418 0
    1887 Australia 4631.746 0
    1888 Australia 4503.7517 0
    1889 Australia 4746.8564 1
    1890 Australia 4457.6762 0
    1891 Australia 4666.4581 0
    1892 Australia 3995.4184 0
    1893 Australia 3707.8584 0
    1894 Australia 3765.5376 0
    1895 Australia 3487.2832 0
    1896 Australia 3684.9276 0
    1897 Australia 3419.9665 -1


  • #2

    Please note comments in the FAQ on references specifically remarking that bare name and date references are elusive. Let's try that in reverse: Miles et al. 2013. Which paper is that? Fortunately the reference here is incidental.

    13. How should I give literature references?

    Please give precise literature references. The literature familiar to you will be not be familiar to all members of Statalist. Do not refer to publications with just author and date, as in Sue, Grabbit, and Runne (1989).

    References should be in a form that you would expect in an academic publication or technical document. Good practice is to give a web link accessible to all or alternatively full author name(s), date, paper title, journal title, and volume and page numbers in the case of a journal article.
    In one jargon, you have spells defined by turning points that start them. For a general discussion see http://www.stata-journal.com/sjpdf.h...iclenum=dm0029 and for a specific command see tsspell (SSC).

    Here I start with

    Code:
    clear
    input year str9  country rgdpmad rgdpmad_point
    1870 Australia 3273.2394 0
    1871 Australia 3298.5075 0
    1872 Australia 3553.4262 0
    1873 Australia 3823.6292 0
    1874 Australia 3834.7969 0
    1875 Australia 4138.207 1
    1876 Australia 4007.2576 0
    1877 Australia 4036.0902 0
    1878 Australia 4277.4006 0
    1879 Australia 4204.9835 0
    1880 Australia 4285.3892 0
    1881 Australia 4454.8259 0
    1882 Australia 4062.6065 -1
    1883 Australia 4475.2758 0
    1884 Australia 4303.5994 0
    1885 Australia 4422.2642 0
    1886 Australia 4329.4418 0
    1887 Australia 4631.746 0
    1888 Australia 4503.7517 0
    1889 Australia 4746.8564 1
    1890 Australia 4457.6762 0
    1891 Australia 4666.4581 0
    1892 Australia 3995.4184 0
    1893 Australia 3707.8584 0
    1894 Australia 3765.5376 0
    1895 Australia 3487.2832 0
    1896 Australia 3684.9276 0
    1897 Australia 3419.9665 -1
    end
    
    egen id = group(country), label
    tsset id year
    tsspell , fcond(rgdpmad_point != 0)
    
    bysort country _spell : egen length = max(_seq) if _spell
    
    list, sepby(country _spell)
    
         +------------------------------------------------------------------------------------+
         | year     country    rgdpmad   rgdpma~t          id   _spell   _seq   _end   length |
         |------------------------------------------------------------------------------------|
      1. | 1870   Australia    3273.24          0   Australia        0      0      0        . |
      2. | 1871   Australia   3298.508          0   Australia        0      0      0        . |
      3. | 1872   Australia   3553.426          0   Australia        0      0      0        . |
      4. | 1873   Australia   3823.629          0   Australia        0      0      0        . |
      5. | 1874   Australia   3834.797          0   Australia        0      0      0        . |
         |------------------------------------------------------------------------------------|
      6. | 1875   Australia   4138.207          1   Australia        1      1      0        7 |
      7. | 1876   Australia   4007.258          0   Australia        1      2      0        7 |
      8. | 1877   Australia    4036.09          0   Australia        1      3      0        7 |
      9. | 1878   Australia     4277.4          0   Australia        1      4      0        7 |
     10. | 1879   Australia   4204.983          0   Australia        1      5      0        7 |
     11. | 1880   Australia   4285.389          0   Australia        1      6      0        7 |
     12. | 1881   Australia   4454.826          0   Australia        1      7      1        7 |
         |------------------------------------------------------------------------------------|
     13. | 1882   Australia   4062.606         -1   Australia        2      1      0        7 |
     14. | 1883   Australia   4475.276          0   Australia        2      2      0        7 |
     15. | 1884   Australia     4303.6          0   Australia        2      3      0        7 |
     16. | 1885   Australia   4422.264          0   Australia        2      4      0        7 |
     17. | 1886   Australia   4329.442          0   Australia        2      5      0        7 |
     18. | 1887   Australia   4631.746          0   Australia        2      6      0        7 |
     19. | 1888   Australia   4503.751          0   Australia        2      7      1        7 |
         |------------------------------------------------------------------------------------|
     20. | 1889   Australia   4746.856          1   Australia        3      1      0        8 |
     21. | 1890   Australia   4457.676          0   Australia        3      2      0        8 |
     22. | 1891   Australia   4666.458          0   Australia        3      3      0        8 |
     23. | 1892   Australia   3995.418          0   Australia        3      4      0        8 |
     24. | 1893   Australia   3707.858          0   Australia        3      5      0        8 |
     25. | 1894   Australia   3765.538          0   Australia        3      6      0        8 |
     26. | 1895   Australia   3487.283          0   Australia        3      7      0        8 |
     27. | 1896   Australia   3684.927          0   Australia        3      8      1        8 |
         |------------------------------------------------------------------------------------|
     28. | 1897   Australia   3419.967         -1   Australia        4      1      1        1 |
         +------------------------------------------------------------------------------------+
    The length of a spell is now there in the data. The amplitude of a spell will be some calculation under

    Code:
    bysort country _spell (year):
    making reference to rgdpmad[1] and rgdpmad[_N] and using a precise definition of average change (absolute? percent? calculated using logarithms?).

    Comment


    • #3
      Dear Mr. Cox,

      thank you very much for your answer, which helped a lot. I didn´t know the tsspell-command, so this helped a lot. I now know how long the duration between the different periods is.
      Now I have the following problem:

      rgdpmad_point consists of 1 and -1. A 1 corresponds to a peak in the business Cycle, the following years then correspond to a recession until -1, which marks a trough. After a trough, the years are an expansion, until another 1 (=peak) appears.

      My goal is to identify the aggregate duration of expansions and recessions. Do you know I could separate rgdpmad_point into expansion - and recession periods?



      Thank you very much in advance
      Attached Files

      Comment


      • #4
        First names are fine here, at least by me. One thing about titles is that you can easily get them wrong.

        Does this help.

        Code:
        . gen rgdpmad_p2 = rgdpmad_point
        
        . bysort id (year) : replace rgdpmad_p2 = rgdpmad_p2[_n-1] if rgdpmad_p2 == 0 & _n > 1 
        (19 real changes made)
        
        . 
        . list, sepby(rgdpmad_p2) 
        
             +---------------------------------------------------------------+
             | year     country    rgdpmad   rgdpma~t          id   rgdpma~2 |
             |---------------------------------------------------------------|
          1. | 1870   Australia    3273.24          0   Australia          0 |
          2. | 1871   Australia   3298.508          0   Australia          0 |
          3. | 1872   Australia   3553.426          0   Australia          0 |
          4. | 1873   Australia   3823.629          0   Australia          0 |
          5. | 1874   Australia   3834.797          0   Australia          0 |
             |---------------------------------------------------------------|
          6. | 1875   Australia   4138.207          1   Australia          1 |
          7. | 1876   Australia   4007.258          0   Australia          1 |
          8. | 1877   Australia    4036.09          0   Australia          1 |
          9. | 1878   Australia     4277.4          0   Australia          1 |
         10. | 1879   Australia   4204.983          0   Australia          1 |
         11. | 1880   Australia   4285.389          0   Australia          1 |
         12. | 1881   Australia   4454.826          0   Australia          1 |
             |---------------------------------------------------------------|
         13. | 1882   Australia   4062.606         -1   Australia         -1 |
         14. | 1883   Australia   4475.276          0   Australia         -1 |
         15. | 1884   Australia     4303.6          0   Australia         -1 |
         16. | 1885   Australia   4422.264          0   Australia         -1 |
         17. | 1886   Australia   4329.442          0   Australia         -1 |
         18. | 1887   Australia   4631.746          0   Australia         -1 |
         19. | 1888   Australia   4503.751          0   Australia         -1 |
             |---------------------------------------------------------------|
         20. | 1889   Australia   4746.856          1   Australia          1 |
         21. | 1890   Australia   4457.676          0   Australia          1 |
         22. | 1891   Australia   4666.458          0   Australia          1 |
         23. | 1892   Australia   3995.418          0   Australia          1 |
         24. | 1893   Australia   3707.858          0   Australia          1 |
         25. | 1894   Australia   3765.538          0   Australia          1 |
         26. | 1895   Australia   3487.283          0   Australia          1 |
         27. | 1896   Australia   3684.927          0   Australia          1 |
             |---------------------------------------------------------------|
         28. | 1897   Australia   3419.967         -1   Australia         -1 |
             +---------------------------------------------------------------+

        Comment


        • #5
          Dear Mr. Cox, this helps a lot, thank you very much! I now have the duration between peaks and troughs and can also refer them to recession and expansion-periods.
          I was now able to calculate, for example the average aggregate duration in the pre-World War I period of recessions, and also expansions. See Do-File.

          Now I would need the average change of output per capita between turning points in % (=amplitude)
          Could you maybe help me again, how to calculate this?

          My work consists on the Paper of Jordà, Schularick and Taylor (2016) - Sovereigns vs. Banks: Credit Crisis and Consequences which is available under http://www.macrohistory.net/?sermons...s-versus-banks
          Attached Files

          Comment


          • #6
            I found a solution which works perfectly in this case

            Code:
            //Therefore I need the log-value
            gen lrgdp = log(rgdpmad)
            
            //amplitude
            bysort country _spell (year): gen diff1 = lrgdp[_N] - lrgdp[1] if _spell
            
            gen diff = diff1*100 if rgdpmad_point[_n+1]==-1 | rgdpmad_point[_n+1]==1
            Thank you very much for your help

            Comment

            Working...
            X