Announcement

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

  • heckman selection on multinomial probit first stage

    Hi All, I am looking for a way to run an OLS with a Heckman correction on data in which the first stage involves 3 choices - I realise there is no specific command in Stata for this, but wonder if someone could advise on an simple way to go about this ? This would be so helpful! I mostly want to check whether my data has sample selection issues - I don't think it does, but I want to be sure. Any advice on how to go about this, especially for someone who is not very fluent with econometrics? Thanks! Tanya

  • #2
    Hi togarra,
    May I ask do you find the answer as I have the same difficulty? Many thanks.
    Best,
    Mengqian

    Comment


    • #3
      You may want to look into the community contributed command
      -cmp-
      it should be able to estimate a model like the one you describe

      Comment


      • #4
        Hi FernandoRioa,
        Thanks a lot for your comment. I find -cmp- helpful. However, when I use -cmp- to conduct Heckman with a first stage of -mprobit-, STATA reports some errors.

        My first-stage Heckman regression is mprobit because I have three categories in the dependent variable, selectvar. I could have used mlogit, but IIA is violated. Therefore, I guess mprobit is a better choice.

        My code is below:

        Code:
        . cmp (outcome = $VarList2 i.fyear) (selectvar= $VarList1, iia) if Obs==1 & Universal=="Yes" , ///
        ind(selectvar*$cmp_cont $cmp_mprobit) nolr qui
        STATA results:

        Code:
        . cmp (outcome = $VarList2 i.fyear) (selectvar= $VarList1, iia)
        > if Obs==1 & Universal=="Yes" , ind(selectvar*$cmp_cont
        > $cmp_mprobit) nolr qui
        
        Fitting individual models as starting point for full model fit.
        
        Fitting full model.
        Likelihoods for 336 observations involve cumulative normal distributions above dimension 2
        > .
        Using ghk2() to simulate them. Settings:
            Sequence type = halton
            Number of draws per observation = 37
            Include antithetic draws = no
            Scramble = no
            Prime bases = 2 3
        Each observation gets different draws, so changing the order of observations in the data s
        > et would change the results.
        
                       cmp_lf1():  3301  subscript invalid
            mopt__calluser_lf2():     -  function returned error
              opt__eval_nr_lf1():     -  function returned error
                     opt__eval():     -  function returned error
        opt__looputil_iter0_common():     -  function returned error
        opt__looputil_iter0_nr():     -  function returned error
                  opt__loop_nr():     -  function returned error
                     opt__loop():     -  function returned error
                    _moptimize():     -  function returned error
                   Mopt_maxmin():     -  function returned error
                         <istmt>:     -  function returned error
        Mata run-time error
        Mata run-time error
        r(3301);
        Do you have any suggestions to improve the code? Many thanks.

        Best,
        Mengqian

        Comment


        • #5
          I wonder if any one would confirm the validity of Mengqian's code.
          cmp (outcome = $VarList2 i.fyear) (selectvar= $VarList1, iia) if Obs==1 & Universal=="Yes" , /// ind(selectvar*$cmp_cont $cmp_mprobit) nolr qui
          Is it ok to proceed this way when we want to run a selection equation (for Heckman procedure) that has more than 2 options (i.e. a multinomial selection variable)?

          Particularly, would the generation of the IMRs through this code be correct?
          Code:
          predict xb, eq(selectvar) xb
          predict e, eq(selectvar) e(0 .)
          gen cmp_mills = e - xb
          Thank you
          Many thanks.
          Last edited by Marry Lee; 02 Feb 2023, 10:24.

          Comment


          • #6
            Sorry about this.

            Comment


            • #7
              Marry Lee -search svyselmlog- for an SSC implementation. Also the original -selmlog- available here. Reading: see also Bourguignon et al. JOURNAL OF ECONOMIC SURVEYS Vol. 21, No. 1, doi 0950-0804/07/01 0174–32

              Comment


              • #8
                Thank you Stephen Jenkins. I will look at the references you mentioned.

                Comment


                • #9
                  Originally posted by Stephen Jenkins View Post
                  Marry Lee -search svyselmlog- for an SSC implementation. Also the original -selmlog- available here. Reading: see also Bourguignon et al. JOURNAL OF ECONOMIC SURVEYS Vol. 21, No. 1, doi 0950-0804/07/01 0174–32
                  Hi Stephan ,

                  I am trying to install selmlog command in stata but the search function doesn't show any results for installlation of the command.
                  I also checked the URL you supplied but I can't open the zipped file. Is there any other way to install this command?

                  Thanks in advance.

                  Regards,
                  Mudabira

                  Comment


                  • #10
                    Code:
                    . ssc d svyselmlog
                    
                    ----------------------------------------------------------------------------------------------------------------------------------------------------------
                    package svyselmlog from http://fmwww.bc.edu/repec/bocode/s
                    ----------------------------------------------------------------------------------------------------------------------------------------------------------
                    
                    TITLE
                          'SVYSELMLOG': module to compute selectivity adjustment based on the multinomial logit for survey design
                    
                    DESCRIPTION/AUTHOR(S)
                          
                           -svyselmlog- estimates the parameters of the main equation
                          correcting  for selectivity using the conditional probabilities
                          from a multinomial logit.  -svyselmlog- allows for three
                          parametric selectivity-correction methods like the  ones
                          developed in Lee (1984), Durbin and McFadden (1984) and
                          Bourguignon, Fournier  and Gurgand (2004). Additionally,
                          selectivity can be adjusted following Dahl's (2002)
                          semi-parametric method.
                          
                          KW: multinomial logit
                          KW: selectivity
                          KW: conditional probabilities
                          
                          Requires: Stata version 8
                          
                          Distribution-Date: 20050921
                          
                          Author: R. E. De Hoyos, University of Cambridge
                          Support: email [email protected]
                          
                    
                    INSTALLATION FILES                           (type net install svyselmlog)
                          svyselmlog.ado
                          svyselmlog.hlp
                    ----------------------------------------------------------------------------------------------------------------------------------------------------------
                    (type ssc install svyselmlog to install)
                    I have also verified that the -selmlog- code in the zip-file is downloadable, and can be extracted by me. (You might have to override a browser's blocking the opening of the file -- the probable reason is that the help file has "hlp" extension, not modern-day "sthlp")

                    Comment

                    Working...
                    X