PANEL DATA STATIONARITY TESTS AND ESTIMATION PROCEDURE
This supplement to the Stata Guide explains how to test for stationarity for a single panel and an entire panel. The data file healthpanel will be used for the examples. You will estimate a healthcare spending model. The dependent variable is spend. The explanatory variables are inc and ins. The commands for doing stationarity tests are dfuller and xtunitroot.
Example
Use a Dickey-Fuller test to test the null hypothesis that spend has a unit root for the state of Michigan. Do the test for three alternative null hypotheses. 1) Spending has a random walk. 2) Spending has a random walk with drift. 3) Spending has a random walk with drift around a stochastic trend.
Commands
tsset state year
dfuller spend in 211/220, nocon
dfuller spend in 211/220
dfuller spend in 211/220 , trend
Comments
The tsset command tells Stata the panel variable (state) and the time variable (year). The in 211/220 range after the variable spend tells Stata to perform the tests for observations 211 through 220. These are the spend time series data for Michigan, which is state 22. The option nocon suppresses the constant term in the regression for the test and indicates the null hypothesis is a random walk without drift. The trend option allows for a stochastic trend. To tell Stata to report the test statistic and the regression results, add the option reg.
Example
Use an augmented Dickey-Fuller test to test the null hypothesis that spend has a unit root for the state of Michigan. Do the test for three alternative null hypotheses. 1) Spending has a random walk. 2) Spending has a random walk with drift. 3) Spending has a random walk with drift around a stochastic trend.
Commands
dfuller spend in 211/220, nocon lags(2)
dfuller spend in 211/220 , lags(2)
dfuller spend in 211/220 , trend, lags(2)
Comments
The commands are the same as the Dickey-Fuller test. But now the Dickey-Fuller regression includes two lagged difference variables to account for possible serial correlation. You may choose any number of lags you desire.
Example
Use the Levin-Lin-Chu (LLC) test to test the null hypothesis that spend has a unit root for all 50 states. Do three versions of the test making the following assumptions. 1) Fixed-effects, no cross-correlation of errors, no state-specific time trends. Use the Akaike information criterion to select the number of lags between one and a maximum of four. 2) Fixed-effects, cross-correlation of errors, no state-specific time trends. Use the Akaike information criterion to select the number of lags between one and a maximum of four. 3) Fixed-effects, cross-correlation of errors, state-specific time trends. Use the Akaike information criterion to select the number of lags between one and a maximum of four.
Commands
xtunitroot llc spend, lags(aic 4)
xtunitroot llc spend, demean, lags(aic 4)
xtunitroot llc spend, demean trend, lags(aic 4)
Comments
You may choose any maximum lag length you desire. If you want to choose the lag length yourself, omit aic from the lags option. For example, if you want to choose three lags include the option lags(3). The option demean tells Stata to account for possible cross correlation of errors among states. For the LLC test, Stata only reports the p-value for the test statistic, not critic values. To accept or reject the null hypothesis, compare the p-value to the level of significance. If the p-value is less than or equal to the level of significance reject the null. If not accept the null.
Example
Use the Harris-Tzavalis (HT) test to test the null hypothesis that spend has a unit root for all 50 states. Do three versions of the test making the following assumptions. 1) Fixed-effects, no cross-correlation of errors, no state-specific time trends. 2) Fixed-effects, cross-correlation of errors, no state-specific time trends. 2) Fixed-effects, cross-correlation of errors, state-specific time trends.
Commands
xtunitroot ht spend
xtunitroot ht spend, demean
xtunitroot ht spend, demean trend
Comments
Like the LLC test, Stata only reports the p-value for the test statistic for the HT test. To accept or reject the null hypothesis, compare the p-value to the level of significance.
Example
Use the version of the Im-Pesaran-Shin (IPS) test that is appropriate when the number of states is large relative to the number of years to test the null hypothesis that spend has a unit root for all 50 states. Do three versions of the test making the following assumptions. 1) Fixed-effects, no cross-correlation of errors, no state-specific time trends. 2) Fixed-effects, cross-correlation of errors, no state-specific time trends. 2) Fixed-effects, cross-correlation of errors, state-specific time trends.
Commands
xtunitroot ips spend
xtunitroot ips spend, demean
xtunitroot ips spend, demean trend
Comments
To use the version of the IPS test that is appropriate when the number states and time period are large, included the lags(#) and choose the number of lags # to include.
Example
Estimate the healthcare spending equation in first-differences.
Commands
tsset state year
gen dspend=d.spend
gen dinc=d.inc
gen dins=d.ins
regress dspend dinc dins
Comments
You must transform each variable to first-difference. The gen command creates the first-difference variables. The first-difference operator is d. It is prefixed to the variable that is transformed to first-difference. To create the first-difference variable, make sure you have previously used the tsset command.
Example
Estimate the healthcare spending equation in first-differences with time dummy variables.
Commands
gen t92=(year==1992)
gen t93=(year==1993)
gen t94=(year==1994)
gen t95=(year==1995)
gen t96=(year==1996)
gen t97=(year==1997)
gen t98=(year==1998)
gen t99=(year==1999)
gen dt92=D.t92
gen dt93=D.t93
gen dt94=D.t94
gen dt95=D.t95
gen dt96=D.t96
gen dt97=D.t97
gen dt98=D.t98
gen dt99=D.t99
gen dt00=D.t00
regress dspend dinc dins dt92 dt93 dt94 dt95 dt96 dt97 dt98 dt99
Comments
You must first create time dummy variables and then transform them to first-differences. You do not include the first-difference time dummy for the first or last year in the series.
Share with your friends: |