Announcement

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

  • Chi-square test for equality of regression coefficients with panel data

    Hello,

    I am using panel data, with firm data where I analyze 13 determinants of ownership by investment funds. I have 15 years of data on approximately 8000 firms. My version of Stata is 14.0 (unfortunately I cannot update since I am using it at my university).

    My basic (simplified) regression looks like this:
    Code:
    xtreg Ownership ESG FirmSize SalesGrowth, fe cluster(ID)
    Now I would like to compare the coefficients of "ESG" from two different regressions, both with another dependent ownership variable, with a chi square test. I have attempted the following:
    Code:
    xtreg Ownership1 ESG FirmSize SalesGrowth, fe cluster(ID)
    est store Option1
    xtreg Ownership2 ESG FirmSize SalesGrowth, fe cluster(ID)
    est store Option2
    suest Option1 Option2
    test ([Option1_mean]_b[ESG ] = [Option2_mean]_b[ESG ])
    This code should work for 'normal' regressions, however in my case with panel data I get the error message: "xtreg is not supported by suest" r(322)
    Does anybody know of an alternative method or a way around this?

    Thanks in advance for any thoughts!

  • #2
    This is a little complicated. You need to duplicate your data, and re-run the regression with a new outcome variable that is Ownership1 in one of the duplicates and Ownership2 in the other, and have an interaction between an indicator for which outcome is used in a given observation and the other variables.

    Code:
    gen long orig_obs_no = _n
    expand 2
    by orig_obs_no, sort: gen which_outcome = _n
    by orig_obs_no (which_outcome), sort: gen outcome = Ownership1 if _n == 1
    by orig_obs_no (which_outcome): replace outcome = Ownership2 if _n == 1
    
    xtset orig_obs_no
    
    xtreg outcome i.which_outcome##(c.ESG c.FirmSize c.SalesGrowth), fe cluster(ID)
    The contrast you are looking for will be in the regression output row for 2.which_outcome#ESG.

    Note: Not tested as no example data was supplied. Beware of typos or other errors.

    Additional note: Coded assuming ESG, FirmSize and SalesGrowth are all continuous variables. If any is discrete, replace it's c. prefix with i..

    Added: This kind of comparison of coefficients in different models can be very problematic, no matter how it is done. Unless Ownership1 and Ownership2 have the same units of measurement and the same distributions in the data, the interpretation of the comparison is going to be unclear.
    Last edited by Clyde Schechter; 22 Jul 2019, 12:36.

    Comment


    • #3
      You're fitting a fixed-effects model, so you could also approach the problem like this.
      Code:
      regress Ownership1 c.(ESG FirmSize SalesGrowth) i.firm // or whatever you call your firm variable
      estimates store Own1
      
      regress Ownership2 c.(ESG FirmSize SalesGrowth) i.firm
      estimates store Own2
      
      suest Own1 Own2
      test [Own1_mean]ESG = [Own2_mean]ESG

      Comment


      • #4
        Dear Joseph, Clyde,

        First of all thank you for you responses, I had run into another problem which is why I've only gotten to this today.
        @Joseph: I tried your approach, unfortunately I got the error message "too many variables specified", which I believe is due to the fact that the sample consists of 4555 firms.

        @Clyde: I attempted your method, I believe the 5th row of your code should be:
        Code:
        by orig_obs_no (which_outcome): replace outcome = Ownership2 if _n==2
        Am I correct? (By using exactly your code I got the error message "insufficient observations")

        Stata reports it has omitted all independent variables (11 in total, but 'ESG' is the variable of interest) due to collinearity (I assume that's supposed to happen)
        The coefficient for "which_outcome#c.ESG2" is statistically significant, but does not match the actual difference between both coefficients when I run the regressions separately.

        Therefore I am unsure how to interpret the output; is there anything else I should add (exact output or something like that) to make it clearer to you? I tried adding a data example, but the command dataex gives the error message: "data width (256 chars) exceeds max linesize. Try specifying fewer variables", even after dropping all variables that are not strictly necessary.

        Comment


        • #5
          @Clyde: I attempted your method, I believe the 5th row of your code should be:
          Code:
          by orig_obs_no (which_outcome): replace outcome = Ownership2 if _n==2
          Am I correct? (By using exactly your code I got the error message "insufficient observations")
          You are correct. My apologies for the error.

          Stata reports it has omitted all independent variables (11 in total, but 'ESG' is the variable of interest) due to collinearity (I assume that's supposed to happen)
          Yes, if there is colinearity, then all but one of the involved variables must be dropped. But if all your independent variables are omitted due to colinearity then you have something wrong with your data (or at least the data is not suitable for this kind of analysis). Offhand, it sounds like all of these variables are simply time-invariant. You cannot estimate the effects of time-invariant variables in a fixed-effects model--it is mathematically impossible. So you need to either see if your data are erroneous, or, if they are correct and all time-invariant, then you need to rethink your question and your model.

          The coefficient for "which_outcome#c.ESG2" is statistically significant, but does not match the actual difference between both coefficients when I run the regressions separately.
          I would need to see the exact code you ran for this along with the exact output you got from Stata to comment on this.

          Comment


          • #6
            Originally posted by Jules de Bresser View Post
            I tried your approach, unfortunately I got the error message "too many variables specified", which I believe is due to the fact that the sample consists of 4555 firms.
            In that case, you can use the non-documented -absorb()- option of -regress-, whose existence I recently discovered here in a thread directly relevant to this one.
            Code:
            regress Ownership1 c.(ESG FirmSize SalesGrowth), absorb(firm)
            estimates store Own1
            
            regress Ownership2 c.(ESG FirmSize SalesGrowth), absorb(firm)
            estimates store Own2
            
            suest Own1 Own2
            test [Own1_mean]ESG = [Own2_mean]ESG

            Comment


            • #7
              The 'absorb' function seems to work, with the one oddity that it leads to slightly higher standard errors: (e.g. 0.0010563 versus 0.0009752). Below are both codes. Any final thoughts on why that's the case (or what is different about my specification of the standard errors?)

              Code:
              xtreg Own ESG FSize Leverage ROA SalesGr Cash_A DivYield MtB FCCR Goodw_A CAPEX_S, fe vce(cluster ID)
              reg Own c.(ESG FSize Leverage ROA SalesGr Cash_A DivYield MtB FCCR Goodw_A CAPEX_S), absorb(ID) vce(cluster ID)
              Edit: I just noticed that suest does not allow me to include clustered standard errors in the regressions of which I store my estimates. I have to include the command -cluster(ID)- in -suest- however doing so increases the standard errors a lot.

              Thank you both for the extremely helpful advice!
              Last edited by Jules de Bresser; 28 Jul 2019, 04:02.

              Comment


              • #8
                Hi Clyde (Clyde Schechter),

                I am using panel data. I estimated results using the following two commands:

                Code:
                reghdfe y x1 x2 x3 if size==0,  absorb(bank t) vce(cluster bank)
                Code:
                reghdfe y x1 x2 x3 if size==1,  absorb(bank t) vce(cluster bank)
                I want to test the equality of x1 coefficients from two equations. Could you please let me know how I can do the Wald test for my panel data?

                Thanks in advance.

                Comment


                • #9
                  S. M. Woahid:
                  I think the best way is to code a single regression with interaction of the two-level categorical variable -size- (0/1) with t-xi1- and then use -test-, -lincom- or -testparm- according to the aim of your comaprison(s).
                  Kind regards,
                  Carlo
                  (StataNow 18.5)

                  Comment


                  • #10
                    Originally posted by S. M. Woahid Murad View Post
                    want to test the equality of x1 coefficients from two equations. Could you please let me know how I can do the Wald test for my panel data?
                    How about something like this?
                    Code:
                    reghdfe y i.size##c.x?, absorb(bank t) vce(cluster bank)
                    test 1.size#c.x1

                    Comment


                    • #11
                      Thank you, Carlo and Joseph, for your responses. However, I get more precise estimations using the techniques posted by Joseph Coveney in #6.

                      Comment

                      Working...
                      X