Cross sectional dependence in panel data analysis can be determined using STATA software by using the commands xtcd and xtcsd. You need to first install the commands into the Stata environment using the call commands: ssc install xtcd and ssc install xtcsd depending on the one you want to use. After that you can implement the commands . Note that xtcsd is a post -estimation command. To use xtcsd you first need to estimate xtreg, or fixed effect or random effect models as applicable to be able to use it. The xtcd command implements cross sectional dependence in panel based on the series by series. Thus, the results will be by series. After getting your results, download credible papers and follow their interpretations. Note that if your results show the presence of cross sectional dependence, you will have to apply unit root tests, cointegration tests and panel data estimators that could accommodate cross sectional dependence. Panel unit root tests like PESCADF, pesaran 2009, Multipurt, Smith and Yamagata 2009 panel unit root test, Cointegration test like Westernlund 2007. Banerjee and Carrion-i- Silvester (2011) can be used. The panel data estimators will no longer be the conventional ones like pooled , fixed effect, random effect, etc . You can then use estimators like common correlated effect pooled (CCEP) , common correlated effect mean group (CCEMG) , Augmented mean group(AMG), etc.
Unless you want to specifically test on that, in the usual frameworks in Applied Microeconometrics, you do not have to worry about it, as the units usually come from random sampling or so.
One of the reasons for this sort of dependence might be spatial effects. In this case, I would have a look at such a literature.
You can use this test in order to see, wheher you have omited variable bias or not. The idea is that your shocks should be random, if your model is correctly specified. Therefore, there should not be any cross - sectional dependence between observations. As it is noted in the paper "XTCSD: Stata module to test for cross-sectional dependence in panel data models": "if the unobserved components that create interdependencies across cross sections are correlated with the included regressors, these approaches willnot work and the FE and RE estimators will be biased and inconsistent. "
Cross sectional dependence in panel data analysis can be determined using STATA software by using the commands xtcd and xtcsd. You need to first install the commands into the Stata environment using the call commands: ssc install xtcd and ssc install xtcsd depending on the one you want to use. After that you can implement the commands . Note that xtcsd is a post -estimation command. To use xtcsd you first need to estimate xtreg, or fixed effect or random effect models as applicable to be able to use it. The xtcd command implements cross sectional dependence in panel based on the series by series. Thus, the results will be by series. After getting your results, download credible papers and follow their interpretations. Note that if your results show the presence of cross sectional dependence, you will have to apply unit root tests, cointegration tests and panel data estimators that could accommodate cross sectional dependence. Panel unit root tests like PESCADF, pesaran 2009, Multipurt, Smith and Yamagata 2009 panel unit root test, Cointegration test like Westernlund 2007. Banerjee and Carrion-i- Silvester (2011) can be used. The panel data estimators will no longer be the conventional ones like pooled , fixed effect, random effect, etc . You can then use estimators like common correlated effect pooled (CCEP) , common correlated effect mean group (CCEMG) , Augmented mean group(AMG), etc.
I agree with you Kehinde Mary Bello. Also, you might need to carry out homogeneity test. When you have both issues of heterogeneity and cross sectional dependence, you can use the tests suggested by Kehinde. Other test you can use is DSUR (dynamic seemingly unrelated regression) estimator. MG and PMG can only handle hetereogenity but not cross sectional dependence.
Anuradha Saikia Better use E.views to test for CD, it has multiple options for testing CD. For small N, and T (Breusch Pegan LM), for large N, and T (Pesaran scaled version), and for large N, and fixed T (Pesaran CD). Other options are in stata, which are xtcsd(frees, Pesaran, and Friedman), xtcd implements the Pesaran CD test; for the slope homogeneity test, you can use "xthst command in Stata (good luck).
Once you apply the GMM estimators, there is no need to worry about cross sectional depedence! I think when someone use fixed and random effects, it is important to check whether cross sectional depedence exist or not.