Announcement

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

  • Real GDP Over the Business Cycle: Amplitude

    Dear all,

    I would like to investigate business cycle features of my dataset.
    Therefore, I used the Bry and Boschan algorithm (from Bry, Gerhard and Charlotte Boschan (1971). Cyclical Analysis of Time Series: Selected Procedures
    and Computer Programs. NBER
    ), which generates dates of peaks and troughs in economic activity for each country in my sample seperately.

    The command therefore was
    Code:
    //Bry and Boschan Algorithm
    sbbq rgdpmad, w(1) p(1) c(1)
    Using real GDP per Capita (variable: rgdpmad), a peak corresponds to a local maximum whereas a trough corresponds to a local minimum.
    The algorithm created two dummy variables: 1 for a business cycle peak, -1 for a business cycle trough.

    To differ between expansion and recession times, I also created the variable rgdpmad_p2
    1 refers to an expansion
    - 1 refers to an recession

    Code:
    //to differ between expansion and recession times
    gen rgdpmad_p2 = rgdpmad_point
    bysort id (year): replace rgdpmad_p2 = rgdpmad_p2[_n-1] if rgdpmad_p2 == 0 & _n>1
    my variables look like the following:

    year country rgdpmad_point _spell _seq _end length rgdpmad_p2
    1870 Australia 0 0 0 0 0
    1871 Australia 0 0 0 0 0
    1872 Australia 0 0 0 0 0
    1873 Australia 0 0 0 0 0
    1874 Australia 0 0 0 0 0
    1875 Australia 1 1 1 1 1 1
    1876 Australia -1 2 1 0 2 -1
    1877 Australia 0 2 2 1 2 -1
    1878 Australia 1 3 1 1 1 1
    1879 Australia -1 4 1 0 2 -1
    1880 Australia 0 4 2 1 2 -1
    1881 Australia 1 5 1 1 1 1
    1882 Australia -1 6 1 1 1 -1
    1883 Australia 1 7 1 1 1 1
    1884 Australia -1 8 1 1 1 -1
    1885 Australia 1 9 1 1 1 1
    1886 Australia -1 10 1 1 1 -1
    1887 Australia 1 11 1 1 1 1
    1888 Australia -1 12 1 1 1 -1
    1889 Australia 1 13 1 1 1 1
    1890 Australia -1 14 1 1 1 -1
    1891 Australia 1 15 1 0 2 1
    1892 Australia 0 15 2 1 2 1
    1893 Australia -1 16 1 1 1 -1
    1894 Australia 1 17 1 1 1 1
    1895 Australia -1 18 1 1 1 -1



    What I know would like to calculate is the amplitude, which denotes the average change of real GDP per Capita between turning points.
    In the paper, I am working with, they say, that amplitude is the absolute log difference between peak and trough levels.
    Which means I have to log my variable rgdpmad

    Code:
    gen lrgdp = log(rgdpmad)
    But then I really don“t find a way to get the amplitude.
    Maybe someone can help?
    Thank you very much in advance

  • #2
    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

    Comment

    Working...
    X