Announcement

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

  • hodrick prescott filter

    Hello
    I want to calculate the trend unemployment of 41 countries with the hodrick prescott filter. what commands should I use? could you please help? thank you.

  • #2
    help tsfilter

    Comment


    • #3
      Is this what you want?
      Code:
        webuse gdp2,clear
        tsfilter hp gdp_hp = gdp_ln
        tsline gdp_hp
      Best regards.

      Raymond Zhang
      Stata 17.0,MP

      Comment


      • #4
        If you need both the trend and cycle, you can use the code below:
        Code:
        webuse gdp2,clear
        tsfilter hp gdp_hp = gdp,smooth(100) trend(tr)
        twoway line gdp gdp_hp tr tq,  ///
                    legend(order(1 "gdp" 2 "Cycle" 3 "Trend") col(1) pos(10) ring(0) region(fc(none) lp(blank)))  ///
                    xtitle("") scheme(s1color)
        Then you can get:
        Attached Files
        Best regards.

        Raymond Zhang
        Stata 17.0,MP

        Comment


        • #5
          Thanks

          Comment

          Working...
          X