Page 1 of 2
Hansen(1999) Threshold Estimation in Panel Data
Posted: Thu Jul 11, 2013 8:44 pm
by TomDoan
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:
- 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.
- The bootstrapping (second part of the program) requires RATS version 8.1 or later as it is written.
- invest.txt
- Data file
- (579.34 KiB) Downloaded 2499 times
Re: Hansen(1999) Threshold Estimation in Panel Data
Posted: Tue Feb 11, 2014 6:49 am
by dnfloro1
Hi Tom,
How do I extend this code into a DYNAMIC PANEL?
Thanks in advance for your reply
DFLORO
Re: Hansen(1999) Threshold Estimation in Panel Data
Posted: Tue Feb 11, 2014 9:00 am
by TomDoan
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.
Re: Hansen(1999) Threshold Estimation in Panel Data
Posted: Tue Jul 22, 2014 9:56 pm
by nbcheikh
Hi Tom,
Is it possible to extend panel threshold test of Hansen (1999) to three breaks?
Thank you in advance,
Re: Hansen(1999) Threshold Estimation in Panel Data
Posted: Wed Jul 23, 2014 9:32 am
by TomDoan
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?
Re: Hansen(1999) Threshold Estimation in Panel Data
Posted: Fri Jul 25, 2014 7:32 pm
by nbcheikh
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.
Re: Hansen(1999) Threshold Estimation in Panel Data
Posted: Sat Jul 26, 2014 12:14 pm
by TomDoan
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).
Re: Hansen(1999) Threshold Estimation in Panel Data
Posted: Wed Mar 25, 2015 4:09 pm
by FaeK
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
Re: Hansen(1999) Threshold Estimation in Panel Data
Posted: Wed Mar 25, 2015 4:33 pm
by TomDoan
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.
Re: Hansen(1999) Threshold Estimation in Panel Data
Posted: Fri Mar 27, 2015 7:21 am
by FaeK
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.
Re: Hansen(1999) Threshold Estimation in Panel Data
Posted: Fri Mar 27, 2015 9:02 am
by TomDoan
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.
Re: Hansen(1999) Threshold Estimation in Panel Data
Posted: Thu Jul 21, 2016 3:43 pm
by Catife
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
Re: Hansen(1999) Threshold Estimation in Panel Data
Posted: Thu Jul 21, 2016 4:56 pm
by TomDoan
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?
Re: Hansen(1999) Threshold Estimation in Panel Data
Posted: Thu Jul 21, 2016 11:39 pm
by Catife
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.
Re: Hansen(1999) Threshold Estimation in Panel Data
Posted: Sun May 28, 2017 8:12 am
by stan076
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 )