Cross-Section Dependence Test


In this section, you will learn to identify cross-section dependence in a panel dataset in STATA. We will explain in detail about them in the following steps:


Step 1: Upload the MS-Excel datasheet in STATA


Let us assume, the name of the MS-Excel datasheet is "Panel-Data-Representation.xlsx" and it is located in the path "D:\data\". Then the data upload command in STATA is given by:

import excel "D:\data\Panel-Data-Representation.xlsx", sheet("DATA") firstrow

Now click ENTER. Your data is uploaded in STATA.



Step 2: Define the data as panel data in STATA

Once the data is uploaded in STATA, we need to define the data to be panel data. For that purpose, we need to declare the cross-section and time-series ids in the data. Then the data declaration command in STATA is given by:

xtset CODE YEAR

Once you click ENTER, you will get the following:

panel variable: CODE (strongly balanced)
time variable: YEAR, 2001 to 2013
delta: 1 unit


Now your data is declared in STATA.



Step 3: Check for cross-section dependence in STATA


Once the data is declared in STATA, you can check for cross-section dependence. The basic command for checking cross-section dependence in STATA is pescadf. In the dataset, there are five variables (POP, EC, PT, Y, and N). Now, we will check for cross-section dependence for any of the variables, e.g. Y. Then the command in STATA is given by:

pescadf Y, lags(1)

Once you click ENTER, you will get the following:



Please note that we have included
lags(1) after the command. For this command, you can adjust the lag length according to the requirement of the study and your convenience. Now, please note that the P-value of Z[t-bar] is very high, and it signifies that the cross-sections are independent in case of Y.

Following these steps, you can easily check for cross-section dependence in STATA. For more information on this test, please give the following command in STATA:


help pescadf

If the
pescadf command is not installed in STATA, then you will have to use the following command in STATA to find and install the code:

findit pescadf


Go Backfast_rewind
add