Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: unit root tests on panel data


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: unit root tests on panel data
Date   Tue, 21 Oct 2003 13:13:45 -0400

Users of panel data have a number of panel unit root tests written by Stata users at their disposal, but often find it highly annoying that the official unit-root test commands such as dfuller, pperron, and now dfgls refuse to work with panel data, even if only a single timeseries within that panel is specified. Of course, one could reshape the data to wide format, or preserve/drop if unit ~=`i'/test/restore, but those workarounds seem unnecessarily complicated. Why can't these commands work with panel data, at least to massage a single timeseries within the panel? With one line of code altered, they can.

ssc install panelunit

provides panel-capable versions of dfgls, dfuller, and pperron named dfgls2, dfuller2, pperron2, respectively. In a panel context, they must be invoked with an 'if' or 'in' qualifier to ensure that a single panel is presented to the routine. That can, of course, be automated to work with all units in a panel (as could be the accumulation of results returned by the routine):

webuse grunfeld, clear
forvalues i=1/10 {
di _n "company `i'"
dfgls2 invest if company==`i'
}

Other than this feature, they work identically to their official relatives, and thus the help-files are those of the official routines. Dialog files are provided.

Kit

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index