Announcement

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

  • testing the significance of the difference between two coefficients of panel data regression

    Hi statalist,

    I am running regression using panel data fixed effect model, i ran the same regression model but across different groups (different stock markets) and got difference in the coefficient of the variables. what i want to do is to test the significance of the difference between the coefficients of the variables across the two stock markets. i have searched alot and i tried using estore suest and test but stata mentioned that suest does not support xtreg. is there any other way i can do it??


    thanks in advance

  • #2
    If I understand you well you are running two different regressions of the following form:
    Code:
    xtreg depvar indepvars if z==0, fe
    xtreg depvar indepvars if z==1, fe
    Then, there are basically two ways to test the difference in coefficients. Instead of xtreg, use reg with dummy variables for the fixed effects, after which you can use suest to compare the coefficients.
    Code:
    reg depvar indepvars i.panelvar if z==0
    reg depvar indepvars i.panelvar if z==1
    The second and I think preferred method is to interact your group var with the independent variables.
    Code:
    xtreg depvar indepvars##i.z, fe
    The test statistic of the coefficient of indepvar#z will tell you directly whether there is a significant difference compared to the base group.

    Comment


    • #3

      xtreg depvar indepvars##i.z, fe first, when using this command the group variable(two stock markets or the z==o or 1) was omitted using the fe. second, i have more than 3000 companies across around 35 years so i can not create dummies.

      Comment


      • #4
        Click image for larger version

Name:	statalist.png
Views:	1
Size:	32.7 KB
ID:	1524522



        Click image for larger version

Name:	stata.png
Views:	1
Size:	30.7 KB
ID:	1524523

        i simply want to test the difference between the coefficients of the dummyincrease variable in the Aim market and that of the Main market. is it significant or not.

        Comment


        • #5
          It's not a problem if the group variable is omitted due to perfect collinearity with the fixed effects. You can then estimate:
          Code:
          xtreg depvar indepvars indepvars#i.z, fe
          indepvars will be the effect for the base group, indepvars#i.z is the additional difference for the other group.

          Comment


          • #6
            sorry but i don't actually get it so i will run the following command,
            xtreg car01 dummyincrease roa dy eps lnmc btm ltdta slope std and then what what is meant by indepvars i .z

            Comment


            • #7
              By indepvars I meant independent variables, so all your variables on the right side of the equation. By i.z I meant your group variable, which appears to be marketquotation. So you will need something like this.
              Code:
              xtreg car01 dummyincrease roa dy eps lnmc btm ltdta slope std (c.dummyincrease c.roa c.dy c.eps c.lnmc c.btm c.ltdta c.slope c.std)#marketquotation, fe
              The 'c.' prefix in the interaction term is necessary for continuous variables. I assume here that all your independent variables are continuous, not categorical. You may have to change that if necessary.

              Comment


              • #8
                thank you so much for your patience.
                kindly find attached what i have reached

                Click image for larger version

Name:	stata1.png
Views:	1
Size:	41.5 KB
ID:	1524635


                My question is how can i interpret the coefficient of dummy quotation c. dummy increase what is the (1) below it and what does this negative coefficient represent?
                i feel like this is not what i am looking for, referring to the 1st picture attached i want to prove that for example in the aim market the coefficient of the dummy increase is (.023213) and the coefficient of the same variable in the main market is (.0156558) so accordingly i want to test if this difference in the coefficients is statistically significant or not. in other words i want to prove that the increase in the aim market is accompanied by higher stock returns compared to that of the main market and i want to support my findings with statistically difference tests.

                thanks again for you help
                much appreciated.

                Comment


                • #9
                  My question is how can i interpret the coefficient of dummy quotation c. dummy increase what is the (1) below it and what does this negative coefficient represent?
                  dummyincrease is the effect of a unit increase in dummyincrease on car01 for the base group (dummyquotation==0). I say 'effect' for simplicity reasons, but it is not certain that you can infer causality. dummyquotation#c.dummy increase is the interaction effect, that is the difference between the effect of dummyincrease on car01 for the base group as compared to the other group (dummyquotation==1). The '1' is how Stata handles factor variables, and simply means that dummyquotation is 1 here, not 0, so you know which group it represents. If the t-statistic here is significant, you have a significant group-wise difference, so this should be exactly what you need.

                  Note that you can calculate the effect of dummyincrease on car01 for the other group by hand now: 0.210039 + -0.0056739 = around 0.155. You can also let Stata calculate this using margins dummyquotation, dydx(dummyincrease).

                  What is weird is that the coefficients are slightly different from your first specification you did with bysort. I cannot see what is different as the variables are all the same. The only thing that seems to have changed is dummyquotation instead of marketquotation so maybe the problem lies there.

                  Comment


                  • #10
                    That's more than perfect, thank you so much. i understand now. however as you have mentioned the strange thing i that the coefficients using the bysort command is different from the one you have stated. they are slightly different i know but the coefficients are not exactly equal. all the variables are the same, i have not changed anything except for the dummy market quotation. the bysort command allows for nominal variables in the by group section that's why i conducted the same regression across the Aim market and the Main market, but when trying to use z. market quotation command stata told me that marketquotation: string variables may not be used as factor variables . so i generated a dummy variable named dummy quotation and i ran the command again ( Aim = 0, Main = 1).

                    Comment


                    • #11
                      Ok that's the right way to do it and shouldn't make a difference. You could try adding i.dummyquotation in the model one more time now you have the full model. If it is dropped you can be sure that you have to leave it out.

                      Comment


                      • #12
                        now it worked, i got the same coefficients as the bysort command.
                        i can't thank you enough, this is really helpful. again than you for your tolerance and concern

                        Comment


                        • #13
                          i noticed that when applying the bysort formula and the one you have mentioned, i do got the same coefficient but different t- value. do you have any idea why this occurred?

                          Comment


                          • #14
                            i think this is related to the standard error, as the t-value is calculated by dividing the coefficient by the standard error. but again what causes that difference in the standard error?

                            Comment


                            • #15
                              The assumptions about the error variance are different. When you estimate separately you are allowing for heteroskedasticity while if you estimate the model with interactions you are imposing homoskedasticity. You may want to use robust standard errors for this reason.

                              See also this discussion: https://www.statalist.org/forums/for...erent-t-values

                              Comment

                              Working...
                              X