Hansen(1999) Threshold Estimation in Panel Data

Use this forum for posting example programs or short bits of sample code.

Hansen(1999) Threshold Estimation in Panel Data

Unread postby TomDoan » Thu Jul 11, 2013 8:44 pm

This is a replication file for Bruce Hansen(1999), "Threshold effects in non dynamic panels: estimation, testing and inference", Journal of Econometrics, vol 93, pp 345-368. It uses the PANELTHRESH procedure to estimate a fixed effects model allowing for up to two breaks in a specific regressor.

Two things to note:
  1. There was a bug in Hansen's original Gauss code which caused it to lose the last time period in each individual's data. This (or actually the PANELTHRESH procedure) handles this correctly.
  2. The bootstrapping (second part of the program) requires RATS version 8.1 or later as it is written.

panelthresh.rpf
Program file
(1.62 KiB) Downloaded 2028 times

invest.txt
Data file
(579.34 KiB) Downloaded 1870 times
TomDoan
 
Posts: 7384
Joined: Wed Nov 01, 2006 5:36 pm

Re: Hansen(1999) Threshold Estimation in Panel Data

Unread postby dnfloro1 » Tue Feb 11, 2014 7:49 am

Hi Tom,

How do I extend this code into a DYNAMIC PANEL?

Thanks in advance for your reply

DFLORO
dnfloro1
 
Posts: 9
Joined: Wed Sep 25, 2013 8:32 am

Re: Hansen(1999) Threshold Estimation in Panel Data

Unread postby TomDoan » Tue Feb 11, 2014 10:00 am

dnfloro1 wrote:Hi Tom,

How do I extend this code into a DYNAMIC PANEL?

Thanks in advance for your reply

DFLORO


You don't. This relies upon repeated fixed effects regressions, which will be biased in the case of a dynamic panel.
TomDoan
 
Posts: 7384
Joined: Wed Nov 01, 2006 5:36 pm

Re: Hansen(1999) Threshold Estimation in Panel Data

Unread postby nbcheikh » Tue Jul 22, 2014 9:56 pm

Hi Tom,
Is it possible to extend panel threshold test of Hansen (1999) to three breaks?
Thank you in advance,
nbcheikh
 
Posts: 9
Joined: Tue Apr 19, 2011 3:43 am

Re: Hansen(1999) Threshold Estimation in Panel Data

Unread postby TomDoan » Wed Jul 23, 2014 9:32 am

nbcheikh wrote:Hi Tom,
Is it possible to extend panel threshold test of Hansen (1999) to three breaks?
Thank you in advance,


Possible? Yes. Easy? Not really. In order to keep the computational burden down, this searches for one break, then the second given the first, then the first (again) given the second. Hansen shows that that gives consistent estimates of the two breaks. That idea probably extends to three breaks, but it's a rather complicated set of calculations.

Why would you want that anyway? If there isn't evidence of a break allowing for two, why would you think three would be different?
TomDoan
 
Posts: 7384
Joined: Wed Nov 01, 2006 5:36 pm

Re: Hansen(1999) Threshold Estimation in Panel Data

Unread postby nbcheikh » Fri Jul 25, 2014 7:32 pm

When I estimated my model I found an evidence of double threshold, so now I want to run the test for a third threshold as Hansen (1999) did in his paper.
nbcheikh
 
Posts: 9
Joined: Tue Apr 19, 2011 3:43 am

Re: Hansen(1999) Threshold Estimation in Panel Data

Unread postby TomDoan » Sat Jul 26, 2014 12:14 pm

nbcheikh wrote:When I estimated my model I found an evidence of double threshold, so now I want to run the test for a third threshold as Hansen (1999) did in his paper.


Quite honestly, if the model shows two breaks, it probably already means that it's just wrong (wrong proxy, wrong specification or something else).
TomDoan
 
Posts: 7384
Joined: Wed Nov 01, 2006 5:36 pm

Re: Hansen(1999) Threshold Estimation in Panel Data

Unread postby FaeK » Wed Mar 25, 2015 4:09 pm

Dear Tom,

I hope that you are well. I run the panelthresh procedure posted above and indeed it tests for single and double threshold effects. However, I am slighly confused as the estimated regression reports only one parameter on the breakvar. Do I need to construct interactive terms (slope dummies) based on the estimated thresholds from the procedure and then run the fixed effect regression to get the switching parameters on the breakvar? or I miss something in this respect. I apologise if this seems to be trivial, but I am not an expert with panel. Many thanks in advance for all the help- it is much appreciated.
Kind Regards, Faek
FaeK
 
Posts: 29
Joined: Tue Jan 03, 2012 9:01 pm

Re: Hansen(1999) Threshold Estimation in Panel Data

Unread postby TomDoan » Wed Mar 25, 2015 4:33 pm

The point of the paper is to demonstrate how to test for break effects in a single regressor. All the other coefficients are treated as fixed. If you follow the links for the @PANELTHRESH procedure, you'll see that someone has previously asked about that.
TomDoan
 
Posts: 7384
Joined: Wed Nov 01, 2006 5:36 pm

Re: Hansen(1999) Threshold Estimation in Panel Data

Unread postby FaeK » Fri Mar 27, 2015 7:21 am

Dear Tom,
Many thanks for the prompt reply. Indeed, I am aware that it tests for a break in a single regressor. I am confused about how to get or estimate the switching parameters on this single regressor (a parameter when the regressor is above the threshold and one it is below the threshold) when the test supports the existence of one threshold effect. Many thanks, Faek.
FaeK
 
Posts: 29
Joined: Tue Jan 03, 2012 9:01 pm

Re: Hansen(1999) Threshold Estimation in Panel Data

Unread postby TomDoan » Fri Mar 27, 2015 9:02 am

The procedure defines %%gamma1_1 as the best single break. So you just create something like

set cf0 = breakvar*(threshvar<=%%gamma1_1)
set cf1 = breakvar*(threshvar>%%gamma1_1)

(where breakvar and threshvar are your series), then run a PREG(METHOD=FIXED) with CF0 and CF1 replacing BREAKVAR in the regressor list.
TomDoan
 
Posts: 7384
Joined: Wed Nov 01, 2006 5:36 pm

Re: Hansen(1999) Threshold Estimation in Panel Data

Unread postby Catife » Thu Jul 21, 2016 3:43 pm

Hi Tom,

If I would like to detect the thresholds in a pooled panel estimation, is it correct to do so by modifying the panelthresh.rpf to be with preg(method=pooled)? Thank you.

Regards
Catife
 
Posts: 9
Joined: Sun Mar 20, 2016 10:18 pm

Re: Hansen(1999) Threshold Estimation in Panel Data

Unread postby TomDoan » Thu Jul 21, 2016 4:56 pm

Catife wrote:Hi Tom,

If I would like to detect the thresholds in a pooled panel estimation, is it correct to do so by modifying the panelthresh.rpf to be with preg(method=pooled)? Thank you.

Regards


A pooled panel regression is just plain old OLS. The point of the Hansen paper is to handle fixed effects and also to deal with the fact that in a large panel data set the number of potential double threshold combinations may be (or may have been given the technology 20 years ago) prohibitively large for a exhaustive search. Note also that this is doing a threshold break in just one regressor. What exactly is it that you're trying to do?
TomDoan
 
Posts: 7384
Joined: Wed Nov 01, 2006 5:36 pm

Re: Hansen(1999) Threshold Estimation in Panel Data

Unread postby Catife » Thu Jul 21, 2016 11:39 pm

TomDoan wrote:
Catife wrote:Hi Tom,

If I would like to detect the thresholds in a pooled panel estimation, is it correct to do so by modifying the panelthresh.rpf to be with preg(method=pooled)? Thank you.

Regards


A pooled panel regression is just plain old OLS. The point of the Hansen paper is to handle fixed effects and also to deal with the fact that in a large panel data set the number of potential double threshold combinations may be (or may have been given the technology 20 years ago) prohibitively large for a exhaustive search. Note also that this is doing a threshold break in just one regressor. What exactly is it that you're trying to do?


Thank you for the reply. Actually, I just suspect there is no individual fixed effect in my model so that I would like to remove the fixed effect setup and see if the thresholds are robust. Therefore, I come to the estimation of pooled panel with thresholds.
Catife
 
Posts: 9
Joined: Sun Mar 20, 2016 10:18 pm

Re: Hansen(1999) Threshold Estimation in Panel Data

Unread postby stan076 » Sun May 28, 2017 8:12 am

Would it be an issue if the threshold variable is not country specific but a common variable to all country? (e.g. world commodity price )
stan076
 
Posts: 9
Joined: Mon Mar 27, 2017 10:37 pm

Next

Return to Examples and Sample Code

Who is online

Users browsing this forum: No registered users and 4 guests