Announcement

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

  • cmp for instrumental multinomial probit when there is cluster, baseoutcome, if conditions

    I have been running non-instrumental multinomial probit that roughly looks like

    Code:
    mprobit Y X C
    where Y is dep var, X is indep var, C are controls.

    Now I wasted add an instrument.

    So after reading some posts from Statalist, it seems typical command for instrumental multinomial probit is the following (is this correct?)

    Code:
    cmp (Y=X C, iia) (X=Z C), ind($cmp_mprobit $cmp_cont)
    where Z is the instrument. I added iia because there is no alternative (Y)-specific controls.

    Thank you for all the posters who made me come this far.

    But what if original non-instrumental multinomial probit model was more complex? It had cluster, baseoutcome, if conditions.

    Code:
    mprobit Y X C if C<100, baseoutcome(1) vce(cluster D)
    Then how should I write instrumental multinomial probit that corresponds to this?

    The following two attempts failed.

    Code:
    cmp (Y=X C, iia) (X=Z C) if C<100, ind($cmp_mprobit $cmp_cont) baseoutcome(1) vce(cluster D)
    Code:
    cmp (Y=X C, iia baseoutcome(1)) (X=Z C) if C<100, ind($cmp_mprobit $cmp_cont) vce(cluster D)

    Webuse example

    By arbitrarily adding fem_work=2, I get a data that I can meaningfully run multinomial probit.

    Code:
    webuse laborsup, clear
    replace fem_work=2 if fem_work==1 & _n<200
    cmp (fem_work = other_inc fem_educ kids) (other_inc = fem_educ kids male_educ), ind($cmp_mprobit $cmp_cont) qui
    This code does not just have cluster, if, baseoutcome. But still this is taking forever to run.. still not finished.
    Last edited by James Park; 21 Mar 2019, 20:45.

  • #2
    cmp does not accept a baseoutcome() option. As explained in the help file, the base outcome must always be first. So if you want another outcome to be the base, recode your outcome variable so the base value gets the lowest number.
    If it's getting stuck on the constants-only model, try adding the nolr option.
    cmp accepts if clauses and the cluster() option per usual syntax.

    Comment


    • #3
      Thank you so much! So I tried running

      Code:
       
       cmp (Y=X C, iia) (X=Z C) if C<100, ind($cmp_mprobit $cmp_cont) vce(cluster D)
      It doesn't produce any error. But is this applying if condition and cluster to both regressions?

      hat I want is that both 1st regression (Y=X C, iia) and 2nd regression (X=Z C) are clustered by D, and both are limited to observations s.t. C<100. Is that what the above line is doing? Or is "C<100" or "vce(cluster D)" being applied to only one of the two regressions?

      I also tried the following two but they throw me error messages so perhaps the above code is something I should do anyways (Perhaps?). But I would like to double-check what it is really doing.. Thank you again so much! cmp is so useful.

      Code:
       
       cmp (Y=X C, iia if C<100) (X=Z C if C<100), ind($cmp_mprobit $cmp_cont)
      Code:
       
       cmp (Y=X C, iia vce(cluster D)) (X=Z C, vce(cluster D)) if C<100, ind($cmp_mprobit $cmp_cont)

      Comment


      • #4
        And another things is that, cmp doesn't seem to recognize _b[X] to save coefficient of X, or _se[X] to save standard error of X. Does cmp have different way of saving them?

        Code:
        replace coef=   _b[X]

        Comment


        • #5
          Yes the if clause and cluster option apply across equations.
          The question about accessing coefficients is a general one about how to refer to results from multi-equation models. See https://www.stata.com/manuals13/u13.pdf

          Comment


          • #6
            Originally posted by David Roodman View Post
            Yes the if clause and cluster option apply across equations.
            The question about accessing coefficients is a general one about how to refer to results from multi-equation models. See https://www.stata.com/manuals13/u13.pdf
            Thank you so much again!

            And meanwhile I encountered another problem. I did some research so my question became long so I posted it as a separate thread: https://www.statalist.org/forums/for...any-categories

            Could you please take a look when you have time?

            Comment


            • #7
              James, I just fixed a bug in cmp that was creating problems for multnomial probit, rank-ordered probit, and/or "gamma" models (that use the # suffix) when the nolrtest option was not in the command line. It should be on SSC soon. You can also access it now via "net from https://raw.github.com/droodman/cmp/v8.3.0". Then follow links to force installation.

              --David

              Comment


              • #8
                Originally posted by David Roodman View Post
                James, I just fixed a bug in cmp that was creating problems for multnomial probit, rank-ordered probit, and/or "gamma" models (that use the # suffix) when the nolrtest option was not in the command line. It should be on SSC soon. You can also access it now via "net from https://raw.github.com/droodman/cmp/v8.3.0". Then follow links to force installation.

                --David

                Thank you very much for letting me know. I just ran

                Code:
                ssc install cmp, replace
                which cmp
                and it shows me

                Code:
                c:\ado\plus\c\cmp.ado
                *! cmp 8.3.3 23 May 2019

                This is the right way to update, correct? And was there another update in May?

                Comment


                • #9
                  Yes, that should be fine.

                  Comment

                  Working...
                  X