Announcement

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

  • Testing the equality of the regression coefficients

    The main regression model

    reghdfe y x controls, absorb (ind fyear) vce(cluster gvkey)

    Now I want to run the same model for two different groups (male/female)

    I have done the following

    regress y x controls i.ind i.fyear if sex==1
    estimate store h1

    regress y x controls i.ind i.fyear if sex==0
    estimate store h0

    suest h1 h0, vce(cluster gvkey)

    test [h1_mean] x = [h0_mean] x

    I get results of the p-value of the difference between the coefficients of x from the above test. But I have a feeling that I am making some mistakes here.

    So, I want to do the same test using a different method and compare the two results. If the results are the same, then I am confident that my first test is correct. But I don't know any other approaches.

    Could anyone please help me with a different method to test the equality of the coefficients of regression?






  • #2
    See this thread here, and in particular Clyde's post #2, and my post #3.

    https://www.statalist.org/forums/for...ion-subsamples

    Comment


    • #3
      Joro, Thank you very much
      I tried the following

      reghdfe y i.sex##c.(x controls), absorb (ind fyear) vce(cluster gvkey)

      From the 2nd one above the interaction term between sex and x should be the expected result.

      But the problem is my two examples so far give me two different results. What mistakes am I doing? Would you please help?
      Also, could you please tell me whether my first example is correct?
      Last edited by Raja Hasan; 15 Apr 2021, 19:31.

      Comment


      • #4
        Like this:

        Code:
        . sysuse auto, clear
        (1978 Automobile Data)
        
        . areg price i.fore##c.(mpg head), absorb(rep)
        
        Linear regression, absorbing indicators         Number of obs     =         69
        Absorbed variable: rep78                        No. of categories =          5
                                                        F(   5,     59)   =       5.08
                                                        Prob > F          =     0.0006
                                                        R-squared         =     0.3113
                                                        Adj R-squared     =     0.2062
                                                        Root MSE          =  2594.8692
        
        ------------------------------------------------------------------------------------
                     price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------------+----------------------------------------------------------------
                   foreign |
                  Foreign  |  -4773.937   4822.429    -0.99   0.326     -14423.6    4875.722
                       mpg |  -421.0379   94.56144    -4.45   0.000    -610.2549   -231.8209
                  headroom |  -553.1329   498.0573    -1.11   0.271    -1549.743    443.4774
                           |
             foreign#c.mpg |
                  Foreign  |    215.251   131.6522     1.63   0.107    -48.18441    478.6864
                           |
        foreign#c.headroom |
                  Foreign  |   261.5519   1405.216     0.19   0.853    -2550.279    3073.383
                           |
                     _cons |   16361.03   3010.441     5.43   0.000     10337.15    22384.91
        ------------------------------------------------------------------------------------
        F test of absorbed indicators: F(4, 59) = 0.684               Prob > F = 0.606
        
        . testparm 1.foreign foreign#c.mpg foreign#c.headroom
        
         ( 1)  1.foreign = 0
         ( 2)  1.foreign#c.mpg = 0
         ( 3)  1.foreign#c.headroom = 0
        
               F(  3,    59) =    1.30
                    Prob > F =    0.2823
        Originally posted by Raja Hasan View Post
        Joro, Thank you very much
        I tried the following

        reghdfe y i.sex##c.(x controls), absorb (ind fyear) vce(cluster gvkey)

        From the 2nd one above the interaction term between sex and x should be the expected result.

        But the problem is my two examples so far give me two different results. What mistakes am I doing? Would you please help?
        Also, could you please tell me whether my first example is correct?

        Comment


        • #5
          If you are are interested whether

          Y = a + b*X + e

          regression differs between males and females, you fit

          Y = a + b*X + f*female + g*female*X + e

          and test Ho: f=0 & g=0.

          Comment


          • #6
            Joro Kolev

            I am now getting confused. Could you please give me an example using the variables in post #1?
            Following post no 5, I did the following

            reghdfe y i.sex##c.x controls, absorb (ind fyear) vce(cluster gvkey)

            Following post no 4, I did the following
            reghdfe y i.sex##c.(x controls), absorb (ind fyear) vce(cluster gvkey)
            testparm 1.sex sex#c.x

            Considering the questions in #1, should I follow #4 or #5?

            None of the examples in #4 and #5 give me similar results as examples in #1.

            Comment


            • #7
              Either use -dataex- to present a sample of your data and say what you want to do with reference to these data, or use some publicly available data like auto.dta and again say what you want with reference to these data.

              There are no variables in #1, you are using pseudo code which can be interpreted in many ways.

              Originally posted by Raja Hasan View Post
              Joro Kolev

              I am now getting confused. Could you please give me an example using the variables in post #1?
              Following post no 5, I did the following

              reghdfe y i.sex##c.x controls, absorb (ind fyear) vce(cluster gvkey)

              Following post no 4, I did the following
              reghdfe y i.sex##c.(x controls), absorb (ind fyear) vce(cluster gvkey)
              testparm 1.sex sex#c.x

              Considering the questions in #1, should I follow #4 or #5?

              None of the examples in #4 and #5 give me similar results as examples in #1.

              Comment


              • #8
                Joro Kolev

                Let me show you an example from the published paper. I want exactly the same thing

                Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	14.3 KB
ID:	1604049

                The dependent variable is investment. So, Lead_Dir affects investment differently when FRQ is low and high.

                It has control varialbes , industry FE and Year FE and they cluster the SE at Firm level.
                What I am looking for is to calculate coef. comp, p-value.

                I hope this clarifies what I am looking for. Using suest, I can do that. I showed an example of it in #1.
                But I can see that suest slightly changes T-statistics or p-value.
                So, I am looking for an alternative ways to do the above analysis.

                Comment


                • #9
                  Can anyone please help me with #8?

                  Comment


                  • #10
                    Raja, I do not know what the authors are doing from looking at the table in #8. In particular it is not clear to me, whether the authors 1) estimate the same parameters on controls, industry FE and year FE, across the two subsamples or 2) the authors estimate different set of parameters over the two subsamples on controls, industry FE and year FE.

                    Therefore, what you have done in #1 is correct, or better said, what you have done makes sense. Whether what you have done is the same as what the authors have done, I have no idea.

                    I can explain what you have done in #1: you have estimated different set of parameters over the two subsamples on controls, industry FE and year FE and your variable of interest. And then you tested whether only your variable of interest is different across the two subsamples.

                    Comment


                    • #11
                      Joro,

                      Yes, the author estimates the same parameters on controls, industry FE and year FE, across the two subsamples.
                      Yes, I also have felt that I am doing the same thing in #1. But I wanted to verify that Suest is giving me the correct p-value.
                      That's why I was looking for different ways to measure the same thing in #8 or in #1.

                      Comment


                      • #12
                        Raja, unless you have communicated with the authors and they told you personally what they have done, you do not know what they have done, because from the table you show in #8 it is not possible to tell. All they say is that they use the same set of controls in the two subsamples, they do not say whether they constrain the estimated parameters on these controls to be the same across the two subsamples.

                        In #1 you allowed the estimated parameters on controls, industry FE and year FE to be different across the two subsamples.

                        In #3 you constrained industry FE and year FE to be the same across the two subsamples, but you allowed the parameters on the controls to be different.

                        #1 and #3 are different procedures, that should give you different results.

                        If you want to replicate what you have done in #1 by the method in #3, the syntax should be something like

                        reg y i.sex##(c.x c.controls i.ind i.fyear), vce(cluster gvkey)

                        and then you only test whether the interaction on x is statistically significant.


                        Originally posted by Raja Hasan View Post
                        Joro,

                        Yes, the author estimates the same parameters on controls, industry FE and year FE, across the two subsamples.
                        Yes, I also have felt that I am doing the same thing in #1. But I wanted to verify that Suest is giving me the correct p-value.
                        That's why I was looking for different ways to measure the same thing in #8 or in #1.

                        Comment


                        • #13
                          Joro Kolev
                          Thank you very much for your time. I now understand why I was getting different answers.

                          Comment

                          Working...
                          X