楼主: zhdstanley
38329 19

[时间序列问题] 如何在stata中执行HP滤波命令 [推广有奖]

11
黃河泉 在职认证  发表于 2019-10-31 18:58:33
  1. use http://fmwww.bc.edu/repec/bocode/h/hamiltonfilterdmonthly.dta, clear

  2. tsset datevar

  3. tsfilter hp hp_cycle = lgrpcecm,
  4. tsline hp_cycle
  5. gen hp_trend = lgrpcecm-hp_cycle
  6. tsline hp_trend
复制代码

12
未点酉 学生认证  发表于 2020-4-1 09:54:58
黃河泉 发表于 2019-10-31 18:58
老师请问面板数据怎么做hp滤波

13
黃河泉 在职认证  发表于 2020-4-1 11:01:12
未点酉 发表于 2020-4-1 09:54
老师请问面板数据怎么做hp滤波
类似
  1. webuse grunfeld, clear
  2. xtset company year
  3. tsfilter hp hp_cycle = invest
  4. gen hp_trend = invest-hp_cycle
复制代码

14
未点酉 学生认证  发表于 2020-4-22 11:17:11
黃河泉 发表于 2020-4-1 11:01
类似
谢谢老师

15
冬天的窝窝头 发表于 2020-7-5 11:31:48 来自手机
黃河泉 发表于 2020-4-1 11:01
类似
面板数据进行HP滤波时,命令为:tsfliter hp newvalist= varlist,smooth(6.25)。请问为何取6.25?文献中一般设置为100或者25。

16
黃河泉 在职认证  发表于 2020-7-5 12:01:26
冬天的窝窝头 发表于 2020-7-5 11:31
面板数据进行HP滤波时,命令为:tsfliter hp newvalist= varlist,smooth(6.25)。请问为何取6.25?文献中一 ...
请看看 help tsfilter
  1. smooth(#) sets the smoothing parameter for the Hodrick-Prescott filter.  By default, if the units of the time variable are set to daily, weekly, monthly, quarterly, half-yearly, or yearly, then the Ravn-Uhlig rule is used to set the smoothing
  2.         parameter; otherwise, the default value is smooth(1600).  The Ravn-Uhlig rule sets # to 1600p^4, where p is the number of periods per quarter.  The smoothing parameter must be greater than 0.
复制代码

17
沙禾 学生认证  发表于 2020-10-18 11:22:05
黃河泉 发表于 2020-7-5 12:01
请看看 help tsfilter
学到了,感谢老师!

18
I谢zZ 发表于 2021-4-2 11:14:07
沙禾 发表于 2020-10-18 11:22
学到了,感谢老师!
我不懂啊  那不是代表4次方吗  怎么是除以4呢

19
早发论文! 发表于 2021-10-30 15:47:37
黃河泉 发表于 2020-4-1 11:01
类似
老师您好,hp-trend就是保留的趋势项对嘛?

20
A猫 发表于 2022-5-3 16:29:56
天MI天 发表于 2016-4-26 16:14
请问非平衡的面板怎么做hp滤波,有gap提示无法做T T求帮助,谢谢!
请问你解决了吗?求教非平衡面板怎么做HP滤波!非常感谢!!

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-29 14:55