Announcement

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

  • How to use SUEST to compare two coefficients produced by CMP

    Hello Statalists,

    I am using CMP to perform an endogenous switching regression based on a treatment event.

    The code is:

    cmp setup
    cmp (y = x1 x2 x3) ///
    (y = x1 x2) ///
    (treatment = x1 x2 x4 x5) , nonrtolerance ///
    indicators(treated control $cmp_probit) robust


    where "treated" in the final row is a dummy with a value of 1 for the treated group and 0 for the control group; "control" is its opposite.
    So for the treated group, the model is y=x1 x2 x3; for the control group, y=x1 x2.

    I am interested in comparing the coefficients of X1 in both the treated and the control groups. I understand that SUEST can do this, but with CMP, it seems unlikely to use the "est store" command as "https://www.statalist.org/forums/forum/general-stata-discussion/general/1415933-suest-for-comparing-regression-coefficients-for-two-different-samples" suggests.

    I only know that the variance-covariance matrix is in e(V), but I don't know how to tell SUEST that.

    Please help. Thanks in advance.

    Leonxf

  • #2
    If SUEST cannot be used to compare these two coefficients, are there other ways? Thx.

    Comment


    • #3
      Use the -test- command. Or, better, use -lincom-.
      Last edited by Clyde Schechter; 16 Aug 2022, 12:00.

      Comment


      • #4
        Originally posted by Clyde Schechter View Post
        Use the -test- command. Or, better, use -lincom-.
        Thank you! Do they do the same as Surest does? And would you mind to share the codes?

        Comment


        • #5
          The exact syntax will depend on the actual names of your variables and the way -cmp- chooses to name the coefficients. Here's an illustration of the general approach that is somewhat similar to your situation:

          Code:
           clear*
           cmp setup
           webuse laborsup
          
          clonevar fem_inc2 = fem_inc
          cmp (fem_inc = fem_educ) (fem_inc2 = fem_educ kids), ///
              indicators($cmp_cont $cmp_cont) nonrtolerance
              
          lincom _b[fem_inc:fem_educ] - _b[fem_inc2:fem_educ]

          Comment


          • #6
            suest is for combining results from several separate estimation commands. You don't need it here because the results are all from one estimation command.
            Clyde's solution will work. In addition, the test command in your example would just be
            Code:
            test _b[y:x1] = _b[y2:x1]

            Comment


            • #7
              Originally posted by David Roodman View Post
              suest is for combining results from several separate estimation commands. You don't need it here because the results are all from one estimation command.
              Clyde's solution will work. In addition, the test command in your example would just be
              Code:
              test _b[y:x1] = _b[y2:x1]

              Thank you for your help, Clyde and David. Now I know how to compare the coefficients in CMP. I wish to ask another question if you don't mind.

              Both the treated and the control groups are domestic firms, they are the subjects of a treatment event. I have a 3rd group of firms, which are foreign. The foreign firms are not the subjects of this treatment, thus not included in the endogenous switching regression of CMP. But I also wish to compare the coefficient of X1 of a similar model of these foreign firms to the coefficients of X1 of the treated and the control in CMP.

              The model for the foreign firms is fixed effects:
              xtset firmindex year
              xtreg y x1 x2 x3, fe robust

              Since CMP doesn't allow "est store", SUEST can't be used. How may I compare the coefficients of X1 across CMP and this fixed effects model?

              Thank you!
              Last edited by leon xf; 18 Aug 2022, 02:09.

              Comment


              • #8
                Originally posted by Clyde Schechter View Post
                The exact syntax will depend on the actual names of your variables and the way -cmp- chooses to name the coefficients. Here's an illustration of the general approach that is somewhat similar to your situation:

                Code:
                clear*
                cmp setup
                webuse laborsup
                
                clonevar fem_inc2 = fem_inc
                cmp (fem_inc = fem_educ) (fem_inc2 = fem_educ kids), ///
                indicators($cmp_cont $cmp_cont) nonrtolerance
                
                lincom _b[fem_inc:fem_educ] - _b[fem_inc2:fem_educ]
                Thank you.

                Is there any way to compare the coefficients from CMP with another fixed effect regression coefficient (please see above)? Or do I have to redesign the research model?

                Thanks again!

                Comment


                • #9
                  cmp definitely does allow est store.

                  Comment


                  • #10
                    Originally posted by David Roodman View Post
                    cmp definitely does allow est store.
                    Thank you, it is good to know.

                    Sorry for my ignorance, but I just learned that SUEST doesn't work for Xtreg either.

                    Is it possible to find the code to do the comparison of CMP coefficients with an outside Xtreg regression coefficient?

                    Thanks!

                    Comment

                    Working...
                    X