Panel HP filtering
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
Panel HP filtering
I HP filtered a panel with 21 nations. Then I unstacked the panel, I took the raw variables and I HP filtered the series one by one (I mean country by country). Surprisingly the filtered output is not the same, why? any hints?
Thanks for helping me.
Thanks for helping me.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13307
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Panel HP filtering
Hi.
I'm sure I understand what you mean by this question. HP filtering is not allowed on panel workfiles (EViews will produce an error message stating this if you try it).
How did you perform the HP filtering?
I'm sure I understand what you mean by this question. HP filtering is not allowed on panel workfiles (EViews will produce an error message stating this if you try it).
How did you perform the HP filtering?
Follow us on Twitter @IHSEViews
Re: Panel HP filtering
EViews 5
a) workfile with panel structure
b) open one series
c) Proc/HP Filter
d) you got the original series filtered
Thanks a lot for your prompt reply
a) workfile with panel structure
b) open one series
c) Proc/HP Filter
d) you got the original series filtered
Thanks a lot for your prompt reply
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13307
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Panel HP filtering
What is the build date of your copy of EViews 5?
(You can check this by clicking on Help->About EViews).
(You can check this by clicking on Help->About EViews).
Follow us on Twitter @IHSEViews
Re: Panel HP filtering
"Standard Edition - Aug 20 2004 build"
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13307
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Panel HP filtering
You're very out-of-date. You should update your copy.
Follow us on Twitter @IHSEViews
Re: Panel HP filtering
Hi all,
I would like to know any update available on this issue since EViews version 5.
I'm using EViews version 7.2, but having a trouble in HP-filtering using panel data.
My code is:
where I have a series named ln_gdp_sa for several countries. I attached my sample data only containing two countries.
Please let me know if there is any way to do HP-filtering for panel data using EViews.
Thank you very much for your help,
Futoshi
I would like to know any update available on this issue since EViews version 5.
I'm using EViews version 7.2, but having a trouble in HP-filtering using panel data.
My code is:
Code: Select all
' Work on counry by country
series temp = @crossid
!ncross = @max(temp)
delete temp
for !i=1 to !ncross
smpl if @crossid = !i
' Detrend using HP-filter
ln_gdp_sa.hpf(lambda=1000) gdp_hp
next
where I have a series named ln_gdp_sa for several countries. I attached my sample data only containing two countries.
Please let me know if there is any way to do HP-filtering for panel data using EViews.
Thank you very much for your help,
Futoshi
- Attachments
-
- sampledata.wf1
- (14.92 KiB) Downloaded 476 times
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13307
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Panel HP filtering
You'll have to copy the series into a non-panel workfile.
Follow us on Twitter @IHSEViews
Re: Panel HP filtering
Hi Gareth,
Thank you so much for your very quick reply!
I'm trying to implement what you advised, but could you fix the following code?
The problem is I cannot copy back the HP filtered series to the paneled page, matching the crossid that is being worked on.
Thank you so much for your very quick reply!
I'm trying to implement what you advised, but could you fix the following code?
The problem is I cannot copy back the HP filtered series to the paneled page, matching the crossid that is being worked on.
Code: Select all
' Create a page to conduct HP-filtering
pagecreate(page=nonpanel) q 1990q1 2012q2
pageselect Untitled1
' Work on counry by country
series temp = @crossid
!ncross = @max(temp)
delete temp
for !i=1 to !ncross
smpl if @crossid = !i
' Detrend using HP-filter
copy(smpl="1990q1 2012q2") ln_gdp_sa nonpanel\ @src @date @dest @date
pageselect nonpanel
ln_gdp_sa.hpf(lambda=1000) gdp_hp
' Here is my problem
copy(smpl="1990q1 2012q2") gdp_hp Untitled1\ @src @date @dest @crossid = !i @date
pageselect Untitled1
next
Re: Panel HP filtering
Hi all,
I figured it out by myself, but thank Gareth anyway for letting me know what I have to do.
I needed more lines and thoughts than I expected to fix my codes above, but anyway the following codes worked. Hope this would be a help to somebody else who wants to do panel HP-filtering using EViews.
Please let me know any easier ways and/or any mistakes. The sample data was attached again just for convenience.
Best Regards,
Futoshi
I figured it out by myself, but thank Gareth anyway for letting me know what I have to do.
I needed more lines and thoughts than I expected to fix my codes above, but anyway the following codes worked. Hope this would be a help to somebody else who wants to do panel HP-filtering using EViews.
Code: Select all
' Open DATA workfile.
open ./sampledata.wf1
smpl @all
' Create a page to conduct HP-filtering
pagecreate(page=nonpanel) q 1990q1 2012q2
pageselect Untitled1
' Work on counry by country
series temp = @crossid
!ncross = @max(temp)
delete temp
for !i=1 to !ncross
' Copy the series of interest to a page without a panel structure.
%strsmpl ="1990q1 2012q2 if @crossid = !i"
copy(smpl={%strsmpl}) ln_gdp_sa nonpanel\ @src @date @dest @date
pageselect nonpanel
' Detrend using HP-filter.
ln_gdp_sa.hpf(lambda=1000) gdp_hp_tmp
' Copy the results to the main page.
copy gdp_hp_tmp Untitled1\ @src @date @dest @date
pageselect Untitled1
smpl if @crossid = !i
series gdp_hp = gdp_hp_tmp
delete gdp_hp_tmp
next
smpl @all
Please let me know any easier ways and/or any mistakes. The sample data was attached again just for convenience.
Best Regards,
Futoshi
- Attachments
-
- sampledata.wf1
- (14.92 KiB) Downloaded 488 times
-
- Posts: 1
- Joined: Mon Sep 30, 2013 8:53 am
Re: Panel HP filtering
Hi
please help me . i have a panel data containing 14 countries for 25 years. i must specify oil shock in those countries. am i true or not? i have to estimate it one by one in all 14 countries? So how should I use them in panel data to estimate asymmetric effect of oil shock in GDP growth?
please help me . i have a panel data containing 14 countries for 25 years. i must specify oil shock in those countries. am i true or not? i have to estimate it one by one in all 14 countries? So how should I use them in panel data to estimate asymmetric effect of oil shock in GDP growth?
-
- Posts: 23
- Joined: Fri Jun 21, 2013 11:34 am
Re: Panel HP filtering
it doesn´t work to me
message error "copy(smpl={strsmpl}) ln_gdp_sa nonpanel\ @src @date @dest @date": strsmpl is not a valid string or scalar name
Please help, im build a panel data set and i want to do HP filter for each company
message error "copy(smpl={strsmpl}) ln_gdp_sa nonpanel\ @src @date @dest @date": strsmpl is not a valid string or scalar name
Please help, im build a panel data set and i want to do HP filter for each company
fnarita wrote:Hi all,
I figured it out by myself, but thank Gareth anyway for letting me know what I have to do.
I needed more lines and thoughts than I expected to fix my codes above, but anyway the following codes worked. Hope this would be a help to somebody else who wants to do panel HP-filtering using EViews.Code: Select all
' Open DATA workfile.
open ./sampledata.wf1
smpl @all
' Create a page to conduct HP-filtering
pagecreate(page=nonpanel) q 1990q1 2012q2
pageselect Untitled1
' Work on counry by country
series temp = @crossid
!ncross = @max(temp)
delete temp
for !i=1 to !ncross
' Copy the series of interest to a page without a panel structure.
%strsmpl ="1990q1 2012q2 if @crossid = !i"
copy(smpl={%strsmpl}) ln_gdp_sa nonpanel\ @src @date @dest @date
pageselect nonpanel
' Detrend using HP-filter.
ln_gdp_sa.hpf(lambda=1000) gdp_hp_tmp
' Copy the results to the main page.
copy gdp_hp_tmp Untitled1\ @src @date @dest @date
pageselect Untitled1
smpl if @crossid = !i
series gdp_hp = gdp_hp_tmp
delete gdp_hp_tmp
next
smpl @all
Please let me know any easier ways and/or any mistakes. The sample data was attached again just for convenience.
Best Regards,
Futoshi
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13307
- Joined: Tue Sep 16, 2008 5:38 pm
-
- Posts: 23
- Joined: Fri Jun 21, 2013 11:34 am
Re: Panel HP filtering
yes i do, exactly
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13307
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Panel HP filtering
The error message would indicate you're missing a %
Follow us on Twitter @IHSEViews
Who is online
Users browsing this forum: No registered users and 12 guests