Stata's xtunitroot command implements a variety of tests for unit roots or stationarity in panel datasets. The Levin–Lin–Chu (2002), Harris–Tzavalis (1999), Breitung (2000; Breitung and Das 2005), Im–Pesaran–Shin (2003), and Fisher-type (Choi 2001) tests have as the null hypothesis that all the panels contain a unit root. The Hadri (2000) Lagrange multiplier (LM) test has as the null hypothesis that all the panels are (trend) stationary. Options allow you to include fixed effects and time trends in the model of the data-generating process.
The assorted tests make different asymptotic assumptions regarding the number of panels in your dataset and the number of time periods in each panel. xtunitroot has all your bases covered, including tests appropriate for datasets with a large number of panels and few time periods, datasets with few panels but many time periods, and datasets with many panels and many time periods. The majority of the tests assume that you have a balanced panel dataset, but the Im–Pesaran–Shin and Fisher-type tests allow for unbalanced panels.
We have data on the log of real exchange rates for a large panel of countries for 34 years. Here we apply the Levin–Lin–Chu test to a subset of data for the G7 countries to examine whether the series lnrxrate contains a unit root. Because we use the United States as the numeraire when computing the lnrxrate series, this subset of data contains six panels.
|Levin-Lin-Chu unit-root test for lnrxrate|
|Unadjusted t -6.7538|
|Adjusted t* -4.0277 0.0000|
The header of the output summarizes the test. The null hypothesis is that the series contains a unit root, and the alternative is that the series is stationary. As the output indicates, the Levin–Lin–Chu test assumes a common autoregressive parameter for all panels, so this test does not allow for the possibility that some countries’ real exchange rates contain unit roots while other countries’ real exchange rates do not. Each test performed by xtunitroot also makes explicit the assumed behavior of the number of panels and time periods. The Levin–Lin–Chu test with panel-specific means but no time trend requires that the number of time periods grow more quickly than the number of panels, so the ratio of panels to time periods tends to zero. The test involves fitting an augmented Dickey–Fuller regression for each panel; we requested that the number of lags to include be selected based on the AIC with at most 10 lags. To estimate the long-run variance of the series, xtunitroot by default uses the Bartlett kernel using 10 lags as selected by the method proposed by Levin, Lin, and Chu.
The Levin–Lin–Chu bias-adjusted t statistic is −4.0277, which is significant at all the usual testing levels. Therefore, we reject the null hypothesis and conclude that the series is stationary. When we use the demean option to xtunitroot to remove cross-sectional means from the series to mitigate the effects of cross-sectional correlation, we obtain a test statistic that is significant at the 5% level but not at the 1% level.
Because the Levin–Lin–Chu test requires that the ratio of the number of panels to time periods tend to zero asymptotically, it is not well suited to datasets with a large number of panels and relatively few time periods. Here we use the Harris–Tzavalis test, which assumes that the number of panels tends to infinity while the number of time periods is fixed, to test whether lnrxrate in our entire dataset of 151 countries contains a unit root:
|Statistic z p-value|
|rho 0.7534 -22.0272 0.0000|
Here we find overwhelming evidence against the null hypothesis of a unit root and therefore conclude that lnrxrate is stationary.