Announcement

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

  • Chow Test - Fixed-Effects Panel Regression

    Dear community,

    I am currently running multiple panel regressions for different time periods. I am attempting to run a Chow Test for the following groups:

    Group==0 : data ranging from 1960-2010
    Group==1 : data ranging from 2011-2018

    The code I run is as follows:

    xtreg loggdp sdem loggdp1 loggdp2 loggdp3 loggdp4 if group==0, fe robust
    //REG RESULTS

    xtreg loggdp sdem loggdp1 loggdp2 loggdp3 loggdp4 if group==1, fe robust
    //REG RESULTS

    generate sdem0=sdem*group if group==0

    generate sdem1=sdem*group if group==1

    gen sdem_10=sdem*group

    xtreg loggdp sdem1 sdem2 loggdp1 loggdp2 loggdp3 loggdp4 , fe robust
    variable sdem2 not found

    When I attempt to run the cumulative regression, I receive the error message in red. Any help on this would be appreciated. Thank you!

    Sally Silk


  • #2
    Well, you should not be surprised that Stata did not find sdem2, as there is nothing in your code that would have created it.

    It appears that you are trying to create an interaction between the demographic group and sdem. You are going about it the hard way, and getting it wrong. Do it the easy way instead:

    Code:
    xtreg loggdp i.sdem##i.group loggdp1 loggdp2 loggdp3 loggdp4 if group==0, fe robust
    Note: In this code, I am assuming that sdem is a discrete variable. If it is continuous, then the first term should be c.sdem##i.group.

    Do read -help fvvarlist- for the general picture and details of factor variable notation.

    Added: When you run this fixed-effects regression, the i.group term will be omitted due to colinearity with the fixed effects. But the sdem#group term(s) will be there, and that term (those terms) will give you your "Chow test."

    Comment


    • #3
      Hi Clyde,

      Thank you very much, the sdem2 was an oversight on my part!

      I used your code to run three regression, one for when group==0, when group==1, and then a cumulative regression. However, I only receive a coefficient in the first two regressions for democracy. How can I use this for the Chow Test? Thanks!


      . xtreg loggdp i.dem##i.group loggdp1 loggdp2 loggdp3 loggdp4 if group==0, fe robust
      note: 0.group omitted because of collinearity.
      note: 1.dem#0.group omitted because of collinearity.

      Fixed-effects (within) regression Number of obs = 5,638
      Group variable: con_cod Number of groups = 156

      R-squared: Obs per group:
      Within = 0.9735 min = 5
      Between = 0.9999 avg = 36.1
      Overall = 0.9986 max = 47

      F(5,155) = 16556.43
      corr(u_i, Xb) = 0.9186 Prob > F = 0.0000

      (Std. err. adjusted for 156 clusters in con_cod)
      ------------------------------------------------------------------------------
      | Robust
      loggdp | Coefficient std. err. t P>|t| [95% conf. interval]
      -------------+----------------------------------------------------------------
      1.dem | .0126208 .0022883 5.52 0.000 .0081006 .017141
      0.group | 0 (omitted)
      |
      dem#group |
      1 0 | 0 (omitted)
      |
      loggdp1 | 1.178548 .070549 16.71 0.000 1.039186 1.317909
      loggdp2 | -.1182758 .0842669 -1.40 0.162 -.2847356 .048184
      loggdp3 | -.0167032 .0257363 -0.65 0.517 -.0675423 .0341359
      loggdp4 | -.0693224 .0179744 -3.86 0.000 -.1048288 -.0338161
      _cons | .2132887 .0355962 5.99 0.000 .1429725 .2836049
      -------------+----------------------------------------------------------------
      sigma_u | .03739991
      sigma_e | .05377499
      rho | .32601153 (fraction of variance due to u_i)
      ------------------------------------------------------------------------------

      . xtreg loggdp i.dem##i.group loggdp1 loggdp2 loggdp3 loggdp4 if group==1, fe robust
      note: 1.group omitted because of collinearity.
      note: 1.dem#1.group omitted because of collinearity.

      Fixed-effects (within) regression Number of obs = 1,245
      Group variable: con_cod Number of groups = 158

      R-squared: Obs per group:
      Within = 0.7232 min = 1
      Between = 0.9997 avg = 7.9
      Overall = 0.9988 max = 8

      F(5,157) = 184.84
      corr(u_i, Xb) = 0.9925 Prob > F = 0.0000

      (Std. err. adjusted for 158 clusters in con_cod)
      ------------------------------------------------------------------------------
      | Robust
      loggdp | Coefficient std. err. t P>|t| [95% conf. interval]
      -------------+----------------------------------------------------------------
      1.dem | .0199747 .0091282 2.19 0.030 .0019448 .0380047
      1.group | 0 (omitted)
      |
      dem#group |
      1 1 | 0 (omitted)
      |
      loggdp1 | .747416 .1867479 4.00 0.000 .3785535 1.116279
      loggdp2 | .0676158 .1313234 0.51 0.607 -.1917727 .3270044
      loggdp3 | .0316843 .0268349 1.18 0.240 -.0213197 .0846883
      loggdp4 | -.0167264 .0218665 -0.76 0.445 -.0599169 .0264642
      _cons | 1.453233 .4270861 3.40 0.001 .609657 2.296809
      -------------+----------------------------------------------------------------
      sigma_u | .24058268
      sigma_e | .04308634
      rho | .96892295 (fraction of variance due to u_i)
      ------------------------------------------------------------------------------

      . xtreg loggdp i.dem##i.group loggdp1 loggdp2 loggdp3 loggdp4, fe robust

      Fixed-effects (within) regression Number of obs = 6,883
      Group variable: con_cod Number of groups = 158

      R-squared: Obs per group:
      Within = 0.9800 min = 2
      Between = 0.9999 avg = 43.6
      Overall = 0.9986 max = 55

      F(7,157) = 26336.10
      corr(u_i, Xb) = 0.9226 Prob > F = 0.0000

      (Std. err. adjusted for 158 clusters in con_cod)
      ------------------------------------------------------------------------------
      | Robust
      loggdp | Coefficient std. err. t P>|t| [95% conf. interval]
      -------------+----------------------------------------------------------------
      1.dem | .0122158 .0020916 5.84 0.000 .0080844 .0163471
      1.group | .0028745 .0040959 0.70 0.484 -.0052157 .0109647
      |
      dem#group |
      1 1 | .0061528 .0042582 1.44 0.150 -.002258 .0145635
      |
      loggdp1 | 1.162024 .0681393 17.05 0.000 1.027436 1.296612
      loggdp2 | -.0941846 .0799571 -1.18 0.241 -.2521151 .0637458
      loggdp3 | -.0148473 .0212934 -0.70 0.487 -.0569057 .0272111
      loggdp4 | -.0782703 .0173809 -4.50 0.000 -.112601 -.0439397
      _cons | .2100089 .033884 6.20 0.000 .1430815 .2769362
      -------------+----------------------------------------------------------------
      sigma_u | .03585092
      sigma_e | .05277996
      rho | .3157172 (fraction of variance due to u_i)
      ------------------------------------------------------------------------------

      Comment


      • #4
        It was not an oversight that I omitted the -if group == 0- and -if group == 1- clauses from the command. This method of doing the "Chow" test is a single regression that produces the difference between the sdem effects in the two group subsets of the data. So the first two regressions you show in #3 are useless, as the restriction to one or the other group destroys the interaction.

        The final version that you ran is close to the correct one. And to the extent it's wrong, that's due to my error. Here's what it should be:
        Code:
        xtreg loggdp i.dem##(i.group c.(loggdp1 loggdp2 loggdp3 loggdp4)), fe robust
        Run that and use its output. Your "Chow" test can be read in the line that is headed by dem#group 1 1. The "coefficient" is the dem effect in group1 minus the dem effect in group 0, and the t-statistic and p-value in that same row are the test statistics for it. The rest of the output can be pretty much ignored, or, at least, is not relevant to the "Chow" test.

        Comment


        • #5
          Thank you so much Clyde! It runs just as I needed now.

          I appreciate your help.

          Comment

          Working...
          X