Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • xttest2: Breusch-Pagan LM test of independence: chi2(3240) = invalid syntax

    Hi,

    i am testing my unbalanced N < T panel for heteroskedasticity using xttest2. In a previous step I ran fixed effects regression as follows:

    Code:
    xtreg AH_PREM MCAP CH_SENT REL_SPREAD L1.CNYUSD_NDF,fe vce (cluster NAME_CO1)
    xttest2
    Everything works fine until after the presentation of the Identity matrix, where I receive the following error:

    Code:
    __e69   0.3543   0.8390   0.7585   0.7584  -0.2059   0.4059   0.2951   0.3921   1.0000
    __e70   0.0330   0.3458   0.7563   0.7522   0.5565   0.3024   0.1455   0.8514   0.4094   1.0000
    __e71   0.1319   0.2260   0.4927   0.6278   0.4012   0.2957   0.1554   0.7593   0.3734   0.6549   1.0000
    __e72   0.3251   0.6921   0.6822   0.6606  -0.1987   0.4098   0.2641   0.3873   0.7841   0.3675   0.5384   1.0000
    __e73   0.2977   0.7040   0.8131   0.8638   0.0419   0.4477   0.2448   0.7312   0.7443   0.6543   0.6783   0.6972   1.0000
    __e74   0.0926   0.1379   0.0866   0.0624  -0.0106   0.0938   0.3084   0.0141   0.0673   0.1147   0.0797   0.1680   0.0950   1.0000
    __e75   0.2281   0.5437   0.3595   0.4422  -0.0757   0.2975   0.4492   0.1974   0.5218   0.2426   0.2693   0.4668   0.4622   0.3196   1.0000
    __e76   0.2615   0.4076   0.5818   0.6541  -0.0075   0.3995   0.1439   0.6318   0.5727   0.4561   0.6923   0.5971   0.7332   0.0615   0.2866
    __e77  -0.1917  -0.3683  -0.0944   0.0675   0.8418  -0.1171  -0.0091   0.4121  -0.2719   0.3869   0.5081  -0.1505  -0.0416   0.0190  -0.0316
    __e78   0.0830   0.1941   0.2609   0.4069   0.3240   0.0978   0.1098   0.4699   0.1527   0.4515   0.4814   0.2401   0.4854   0.2297   0.3185
    __e79  -0.2275  -0.3624   0.0492   0.0796   0.7634  -0.1384  -0.0657   0.3746  -0.2521   0.3964   0.1971  -0.2820  -0.1373  -0.0973  -0.1529
    __e80   0.3130   0.9143   0.7481   0.7086  -0.2947   0.4471   0.3288   0.2853   0.8539   0.4024   0.2089   0.7132   0.6708   0.1395   0.5010
    __e81  -0.2583  -0.6737  -0.5295  -0.4560   0.6088  -0.3167  -0.1667  -0.0938  -0.6721  -0.0362   0.0206  -0.5038  -0.4948   0.0804  -0.2305
    
             __e76    __e77    __e78    __e79    __e80    __e81
    __e76   1.0000
    __e77   0.0424   1.0000
    __e78   0.2860   0.3738   1.0000
    __e79  -0.0352   0.7058   0.1775   1.0000
    __e80   0.4241  -0.4247   0.1366  -0.3057   1.0000
    __e81  -0.3921   0.7340   0.1120   0.5534  -0.7262   1.0000
    
    Breusch-Pagan LM test of independence: chi2(3240) = invalid syntax
    What am I doing wrong?

    Thanks a lot for the help.

  • #2
    Welcome to Statalist.

    The xttest2 command is a user-written extension to Stata. The output of search xttest2 shows several versions originating in the Stata Journal, but also one in the SSC archives, which seems to be the latest.

    So first, make sure you have the latest version of xttest2 installed.
    Code:
    . which xttest2
    /Users/lisowskiw/Library/Application Support/Stata/ado/plus/x/xttest2.ado
    *! version 1.0.5  15aug2011  CFBaum
    If that's not what you have, get the latest version as follows.
    Code:
    ]
    . ssc install xttest2.pkg, replace
    checking xttest2 consistency and verifying not already installed...
    
    the following files will be replaced:
        /Users/lisowskiw/Library/Application Support/Stata/ado/plus/x/xttest2.ado
        /Users/lisowskiw/Library/Application Support/Stata/ado/plus/x/xttest2.hlp
    
    installing into /Users/lisowskiw/Library/Application Support/Stata/ado/plus/...
    installation complete.

    Comment


    • #3
      Philip:
      as an aside to William's helpfule advice, if you're dealing with a small N, large T panel dataset, you should consider -xtgls-.
      See, if interested, http://www.stata-journal.com/sjpdf.h...iclenum=st0084.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Hello,

        thanks for the quick answers and the interesting paper.

        I have the latest version of xttest2 installed (in combination with Stata13.0). Is there anything else I could try to make this test work?


        On xtgls; I used the model on my data and z statistics seem oddly high:

        Code:
        .  xtgls AH_PREM MCAP CH_SENT REL_SPREAD L1.CNYUSD_NDF, force panels(heteroskedastic) corr(independent)
        
        Cross-sectional time-series FGLS regression
        
        Coefficients:  generalized least squares
        Panels:        heteroskedastic
        Correlation:   no autocorrelation
        
        Estimated covariances      =        81          Number of obs      =    113679
        Estimated autocorrelations =         0          Number of groups   =        81
        Estimated coefficients     =         5          Obs per group: min =       822
                                                                       avg =  1403.444
                                                                       max =      1571
                                                        Wald chi2(4)       = 308902.53
                                                        Prob > chi2        =    0.0000
        
        ------------------------------------------------------------------------------
             AH_PREM |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                MCAP |  -2.08e-07   1.40e-09  -148.45   0.000    -2.11e-07   -2.05e-07
             CH_SENT |   .1313982   .0010019   131.15   0.000     .1294345    .1333618
          REL_SPREAD |    -.60441   .0014114  -428.25   0.000    -.6071762   -.6016438
                     |
          CNYUSD_NDF |
                 L1. |   .1198656   .0031355    38.23   0.000     .1137202     .126011
                     |
               _cons |  -.1811129   .0201316    -9.00   0.000    -.2205701   -.1416558
        ------------------------------------------------------------------------------
        How can I test which autocorrelation and error structure option should be used?

        Further, I am currently in the process of replicating findings of a related paper on a similar topic before trying to add another set of explanatory variables. The paper I am speaking of "US ADR and Hong Kong H-share discounts of Shanghai-listed firms by Arquette et. al" finds much lower p values combined with high r^2. Im really struggling to get behind this. Xtgls doesn´t seem to be suitable for the reporting of r^2. This would point towards an OLS model. Is there anything that could be suitable?


        Comment


        • #5
          Philip:
          what if you impose:
          Code:
          panels(correlated)
          instead of:
          Code:
          force panels(heteroskedastic) corr(independent)
          ?
          Besides, -xtgls- does not report R2 but chi2.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Hi Carlo,

            I tried to run
            Code:
            xtgls AH_PREM MCAP CH_SENT REL_SPREAD L1.CNYUSD_NDF, force panels(correlated)
            However, I cannot use it with my unbalanced panel. If there´s no other way I could drop panels to achieve balancing. Would this make sense?

            Comment


            • #7
              Philip:
              you may want to try:
              Code:
              xtgls AH_PREM MCAP CH_SENT REL_SPREAD L1.CNYUSD_NDF, panels(hetero) corr(ar1)
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Hi Carlo,

                Thanks again for the helpful feedback

                I ran the regression it did work. However, the test statistics are still unbelievably high.

                I came across the issue with stationary variables which might cause significant results without real causality. I am wondering if I should first difference my variables. Can I combine stationary and non-stationary variables within my regression model?

                In my specific case I would first difference the forward exchange rate (CNYUSD_NDF) and the liquidity measure (REL_SPREAD), my dependent variable AH_PREM (the percentage difference between two stock prices listed on different exchanges for the same company) I would not difference.

                Code:
                 
                 xtgls AH_PREM MCAP CH_SENT d1.REL_SPREAD d1.L1.CNYUSD_NDF, panels(hetero) corr(ar1)

                Comment


                • #9
                  Philip:
                  I cannot comment on your approach as I'm quite unfamiliar with financial econometrics.
                  That said:
                  - I fail to follow what you're aiming at via -d1.- a lagged variable (but this may well be due to my abovementioned lack of familiarity with the whole stuff).
                  As a sidelight, I would be cautious in seeing causation when, all in all, what you can have is basically the strenght of an association.
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment

                  Working...
                  X