Solved – Understanding Fisher unit root test in Stata: trend, demean

I am testing a panel data set for unit roots. I am using xtunitroot fisher (option) dfuller (as opposed pperron) in Stata.

First, I have drawn a scatter plot of my variables of interest against a time variable to see if there is a time trend. Many of my variables seem to have a time trend. Now, I am unsure as to which options to employ in my Fisher unit-root test.

  • I assume that I should use trend for those variables that appear to have a time trend; but, if I test for a unit root using the trend option, does that mean that I somehow have to correct for a time trend in my regression model?
  • Also, I'm not sure how to know if I should use the demean option (see page 2 of the help file).

Does anyone have an idea on this?

P.S. Command names and some details were edited following the answer by Richard Hardy.

Are you using the regular dfuller or the xtunitroot? Fisher has nothing to do (at least directly) with the regular dfuller, so I wonder why you are mentioning that. I will for now give an answer assuming you are using dfuller.

You might need to use drift rather than trend as an option in the dfuller function. If you observe a linear time trend in the data, it is normally called "drift" rather than "trend". Using trend gives a quadratic time trend in the data (but a linear time trend in first differences). See more details in the help file for the dfuller command, especially page 2.

If there is a drift or a trend in the data, it would of course make sense to account for it not only in the unit root testing but also later when you model the variable in levels or first differences. Just as you are including a drift and/or a trend term in the test equation, you could include these terms in the model later on (just watch out whether the dependent variable is in levels or first differences and adjust accordingly).

I do not see the demean option in the dfuller command (could you indicate more precisely where you encounter it?), so I cannot comment on it.


Now that the command names and some details have been edited in the original post, I am updating my answer.

  • The basic logic related to trends is still the same, and my original answer does not change.
  • Regarding demean, this option is said to subtract the cross-sectional average for the given time point from all series, and do this for all time points. I am not sure if this is a secure choice. For example, if all time series are cointegrated and are driven by just one stochastic time trend, demean will effectively remove that stochastic trend and all the series will be stationary. But that does not make the original series stationary (they are integrated). I do not know this methodology well, so perhaps I am missing something. You should rather check the reference in the help file for details. And here is what Levin et al. (2002) say about the idea of demeaning (emphasis is mine):

    For practical purposes, the panel based unit root tests suggested in this paper are more relevant for panels of moderate size. If the time series dimension of the panel is very large then existing unit root test procedures will generally be sufficiently powerful to be applied separately to each individual in the panel, though pooling a small group of individual time series can be advantageous in handling more general patterns of correlation across individuals (cf. Park, 1990; Johansen, 1991). On the other hand, if the time series dimension of the panel is very small, and the cross-section dimension is very large, then existing panel data procedures will be appropriate (cf. MaCurdy, 1982; Hsiao, 1986; Holtz-Eakin et al., 1988; Breitung and Meyer, 1991). However, panels of moderate size (say, between 10 and 250 individuals, with 25–250 time series observations per individual) are frequently encountered in industry-level or cross-country econometric studies. For panels of this size, standard multivariate time series and panel data procedures may not be computationally feasible or sufficiently powerful, so that the unit root test procedures outlined in this paper will be particularly useful.


  • Levin, Andrew, Chien-Fu Lin, and Chia-Shang James Chu. "Unit root tests in panel data: asymptotic and finite-sample properties." Journal of Econometrics 108.1 (2002): 1-24.

Similar Posts:

Rate this post

Leave a Comment