Announcement

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

  • Margins after oprobit and suest generates error

    I want to estimate 14 ordered probit models, then stack these in a seemingly unrelated regression, then generate marginal effects, and finally test whether the marginal effects for a particular set of variables are jointly significant. The dependent variable in the ordered probit has 3 values: 1, 2, and 3. When I use margins after suest, I am getting an error message.

    My code is as follows:

    oprobit base_freq1 MLB_dma_1 MLB_dma_2 `X_dma' i.wave `FE_dma' if (female==0 & noMLBdma==0) [iw=wtd];
    estimates store m1 ;

    oprobit soc_freq1 MLS_dma_1 MLS_dma_2 `X_dma' i.wave `FE_dma' if (female==0 & noMLSdma==0) [iw=wtd];
    estimates store m2 ;
    .
    .
    .
    suest m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12 m13 m14 , vce(cluster `clus_dma') ;

    margins, dydx(MLB_dma_1 MLB_dma_2) predict(equation(m1) outcome(1)) post;


    After the margins command I get the following error message:

    Warning: cannot perform check for estimable functions.
    equation 1 not found
    r(303);

    How can I get margins to output the marginal effects and their standard errors? I've tried looking at past posts and the manuals but have not found a solution to this problem. I was able to run Wald tests on the cofficients of the oprobit models after suest, but I really want to run hypothesis tests on the marginal effects, not the coefficients. Any help will greatly appreciated!


  • #2
    Try running

    Code:
    suest, coefl
    before running margins. I suspect you have the equation names wrong. Equation and outcome are synonyms for each other.

    margins is not listed as a post-estimation command for suest, so I don't know if you can get this to work or not.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    Stata Version: 17.0 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Thanks Richard! Using your suggestion, I figured out that margins will not work after suest, at least for the ordered probit. When I did get margins to run after suest, it outputted the oprobit cofficients, not the marginal effects. I also got the same warning message. So I think margins does not work as a post-estimation command for suest.

      I tried to get around this problem by running margins immediately after oprobit, saving the marginal effects with estimates store, and then running suest. However I now get a different error message.

      Code:
      oprobit base_freq1 MLB_dma_1 MLB_dma_2 `X_dma' i.wave `FE_dma' if (female==0 & noMLBdma==0) [iw=wtd];
      margins, dydx(MLB_dma_1 MLB_dma_2) predict(outcome(1)) post;
      estimates store m1 ;

      oprobit soc_freq1 MLS_dma_1 MLS_dma_2 `X_dma' i.wave `FE_dma' if (female==0 & noMLSdma==0) [iw=wtd];
      margins, dydx(MLS_dma_1 MLS_dma_2) predict(outcome(1)) post;
      estimates store m2 ;

      suest m1 m2, vce(cluster `clus_dma') ;


      After suest, I get the following error message:

      m1 was estimated with a nonstandard vce (delta)
      r(322);

      Do you know a way to resolve this problem?

      Comment


      • #4
        I don't know if this is a lost cause or not. I might try simplifying the problem. In particular, you could specify the -nose- option on margins and see if it will give you something.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        Stata Version: 17.0 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          Tried the -nose- option with margins and it didn't work. Got the following error message after running suest:

          impossible to retrieve e(b) and e(V) in m1
          r(198);

          Thanks for your help anyway! At least I know this problem is not due to a syntax error on my part.

          Comment


          • #6
            suest takes away all command specific options from predict.

            For margins, the only workable generic predict option is xb;
            the pr option normally allowed (and the default) after oprobit is no
            longer available with the suest results.

            All is not lost, because you can reconstruct the pr formula using the
            expression() with margins.

            Here is a simple example with a single oprobit model fit using the
            auto data:

            Code:
            sysuse auto
            
            oprobit rep turn trunk dispel
            est store o1
            
            * -margins- using -pr- option
            margins, dydx(turn) predict(pr outcome(2))
            
            * -margins- using expression, same results
            margins, dydx(turn)                                     ///
                    expression(                                     ///
                            normal(xb() - _b[cut1:_cons])           ///
                            -                                       ///
                            normal(xb() - _b[cut2:_cons])           ///
                    )
            
            suest o1, coeflegend
            
            * -margins- using expression, only SE different because of robust VCE
            margins, dydx(turn)                                     ///
                    expression(                                     ///
                           normal(xb(rep78) - _b[cut1:_cons])       ///
                            -                                       ///
                            normal(xb(rep78) - _b[cut2:_cons])      ///
                    )

            Comment


            • #7
              Thanks, Jeff. This method does indeed work. I am having one last problem, though. What expression do I specify to generate the marginal effects for the 1st and 3rd outcomes? The dependent variable has three outcomes, and you provided the code for the 2nd outcome. Apologies in advance if this is a really basic question. I guess I don't fully understand how the "predict ()" option relates to the "expression ()" option.

              Comment


              • #8
                OK I figured it out after reading this:

                http://www.stata.com/support/faqs/st...cs/cut-points/

                Thanks for your help!

                Comment

                Working...
                X