Announcement

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

  • movestay. endogenous switching regression, 2+ outcomes selection equation

    Hi guys!

    I was wondering whether there is a way to run an endogenous switching regression when the selection equation involves more than 2 outcomes. movestay does not seem to support that.

    thanks,
    ​Natalia

  • #2
    Hi Natalia.
    I do think you might be looking into the user written command Oheckman. The caveat, perhaps is that the first stage is an order probit, instead of a more general multinomial probit.
    Perhaps that is what you need
    Best
    Fernando

    Comment


    • #3
      hi fernando!

      in the first stage i'm looking at obesity levels so an ordered probit makes sense. however, isn't this ado designed for heckman selection models and not endogeneous switch ones?

      natalia

      Comment


      • #4
        i guess my confusion is the result of the fact that as opposed to a heckman situation, in my case i observe the outcome for all regimes...so i know say, what is the wage of a regular weight, over-weight and obese person...

        Comment


        • #5
          Hi Natalia,
          Intrinsically, the Movestay command is an adjusted version of the old -tretreg- (stata 12).
          On the first stage it estimates a heckman model, and i the second, it introduces the correction terms (accordingly) into the output equations. The difference with tretreg is that instead of estimating two different models, treatreg uses only one equation model (think of it as the difference between using a dummy, or two separate equations to in a oaxaca-blinder decomposition type of analysis.
          The same strategy is used in the oheckman model. For confirmation, why dont you use the oheckman (using only two categories) and you will see they give you the same results (with rounding errors).
          Hope this helps
          Fernando

          Comment


          • #6
            Hi guys I would like to use a multinomial endogenous switching regression but I don't know how to do it in STATA. Please if you have a sample do file kindly share it with me. Thanks!

            Comment


            • #7

              Hello Fernando,
              I am using Stata 14. I have installed my oheckman command from (SJ7-2: st0123) and don't remember where did i installed movestay from (How do we check the source after installing?). I have been using movestay for my endogenous switching regression (labour market). I wanted to run oaxaca for decompostion, but could not find anything that could help me with oaxaca after movestay estimation. I found in the above comment of yours about oheckman and movstay giving same result. I thought may be i could use oheckman with oaxaca, but there are some error for oheckman command.

              Command Movestay:
              movestay (LgWg Female1 Rural1 NeverMarried1 TechEdu1 YearsOfEducation Age AgeSq SocialGrp1 SocialGrp2 SocialGrp3 Relign1 Relign2), select(Highwg Female1 Rural1 NeverMarried1 TechEdu1 YearsOfEducation Age AgeSq SocialGrp1 SocialGrp2 SocialGrp3 Relign1 Relign2 HoHEdu_Level ValueOfConsumption30Days)
              Fitting initial values .....
              Iteration 0: log likelihood = -58226.585
              Iteration 1: log likelihood = -58157.096
              Iteration 2: log likelihood = -58156.484
              Iteration 3: log likelihood = -58156.484

              Endogenous switching regression model Number of obs = 59143
              Wald chi2(12) = 2794.94
              Log likelihood = -58156.484 Prob > chi2 = 0.0000
              Coef. Std. Err. z P>z [95% Conf. Interval]
              LgWg_1
              Female1 .0971449 .0094778 10.25 0.000 .0785687 .1157211
              Rural1 .0045184 .0063062 0.72 0.474 .0078414 .0168783
              NeverMarried1 -.026173 .0119653 -2.19 0.029 .0496245 -.0027215
              TechEdu1 .1318623 .0101472 12.99 0.000 .1119741 .1517505
              YearsOfEducation .028232 .000898 31.44 0.000 .0264719 .029992
              Age -.0058623 .0026352 -2.22 0.026 .0110272 -.0006973
              AgeSq .0002276 .0000317 7.18 0.000 .0001654 .0002897
              SocialGrp1 .016831 .0104722 1.61 0.108 .0036943 .0373562
              SocialGrp2 -.0551694 .0096879 -5.69 0.000 .0741574 -.0361814
              SocialGrp3 -.0799899 .0072541 -11.03 0.000 .0942076 -.0657721
              Relign1 -.0136886 .0099006 -1.38 0.167 .0330933 .0057161
              Relign2 -.0339452 .0099969 -3.40 0.001 .0535388 -.0143517
              _cons 5.972815 .0571467 104.52 0.000 5.860809 6.084821
              LgWg_0
              Female1 -.332986 .0052325 -63.64 0.000 .3432415 -.3227304
              Rural1 -.0076181 .0046665 -1.63 0.103 .0167643 .0015281
              NeverMarried1 -.0545071 .0076402 -7.13 0.000 .0694816 -.0395326
              TechEdu1 .0618608 .0169353 3.65 0.000 .0286683 .0950534
              YearsOfEducation .0030634 .0006276 4.88 0.000 .0018334 .0042934
              Age .0164929 .0016059 10.27 0.000 .0133454 .0196403
              AgeSq -.0002267 .000021 -10.81 0.000 .0002679 -.0001856
              SocialGrp1 -.0509528 .0080047 -6.37 0.000 .0666417 -.035264
              SocialGrp2 .0002649 .0067132 0.04 0.969 .0128927 .0134225
              SocialGrp3 -.0074975 .005853 -1.28 0.200 .0189692 .0039742
              Relign1 -.0139758 .0070668 -1.98 0.048 .0278265 -.0001251
              Relign2 .1185262 .0085419 13.88 0.000 .1017843 .135268
              _cons 4.572867 .030442 150.22 0.000 4.513202 4.632533
              Highwg
              Female1 -.6574639 .0170263 -38.61 0.000 -.690835 -.6240929
              Rural1 -.2027037 .0127465 -15.90 0.000 .2276863 -.1777211
              NeverMarried1 -.0537769 .0227233 -2.37 0.018 .0983138 -.00924
              YearsOfEducation .0761885 .0021021 36.24 0.000 .0720684 .0803086
              Age .081488 .0049085 16.60 0.000 .0718675 .0911084
              AgeSq -.0006553 .0000618 -10.61 0.000 .0007763 -.0005342
              SocialGrp2 -.0810457 .0190536 -4.25 0.000 .1183901 -.0437013
              SocialGrp3 -.034727 .0154754 -2.24 0.025 .0650582 -.0043958
              Relign1 .1032603 .0197185 5.24 0.000 .0646128 .1419078
              Relign2 .2597465 .0214172 12.13 0.000 .2177696 .3017235
              TechEdu1 .2575649 .0300161 8.58 0.000 .1987345 .3163954
              SocialGrp1 .0798819 .0221549 3.61 0.000 .036459 .1233047
              HoHEdu_Level .0496705 .002896 17.15 0.000 .0439944 .0553467
              ValueOfConsumption30Days .0000673 1.26e-06 53.39 0.000 .0000649 .0000698
              _cons -3.558502 .0962428 -36.97 0.000 3.747134 -3.369869
              /lns1 -.7197982 .0067224 -107.07 0.000 .7329739 .7066225
              /lns2 -.901243 .0041086 -219.35 0.000 .9092957 .8931903
              /r1 -.755531 .0200177 -37.74 0.000 .7947649 .7162971
              /r2 -.224644 .0185302 -12.12 0.000 .2609627 .1883254
              sigma_1 .4868505 .0032728 .480478 .4933076
              sigma_2 .4060646 .0016684 .4028078 .4093477
              rho_1 -.6384371 .0118584 .6610999 .6146104
              rho_2 -.2209399 .0176257 .2551957 .1861302
              LR test of indep. eqns. : chi2(1) = 11561.06 Prob > chi2 = 0.0000
              Command oheckman:
              oheckman LgWg Female1 Rural1 NeverMarried1 TechEdu1 YearsOfEducation Age AgeSq SocialGrp1 SocialGrp2 SocialGrp3 Relign1 Relign2, select(Highwg Female1 Rural1 NeverMarried1 TechEdu1 YearsOfEducation Age AgeSq SocialGrp1 SocialGrp2 SocialGrp3 Relign1 Relign2 HoHEdu_Level ValueOfConsumption30Days)
              Result
              initial values not feasible
              r(1400);

              Also, while using oaxaca command, I got confused about the categorical option in the command syntax. I do have some dummies

              1. Do I need to write down all the dummy variables used in this option, even the two category variables which has one dummy?
              2. Since in the categorical option we write all the dummies even the reference category, it would mean 3 dummies for 3 category variable?, do we write these reference category dummy in the model1 and model2 option as well and in the indepvars?

              syntax from Ben Jann (2004) https://core.ac.uk/download/pdf/6442665.pdf:
              oaxaca depvar indepvars if in weight , by(groupvar) swap detail (dlist) adjust(varlist) threefold (reverse) weight(# # . . . ) pooled (model opts) omega (model opts) reference(name) split x1(names and values) x2(names and values) categorical(clist) svy (svyspec) vce(vcetype) cluster(varname) fixed (varlist) no suest nose model1(model opts) model2(model opts) xb noisily level(#) eform

              Sorry for the long post and number of questions.
              Thank you

              Comment


              • #8
                Hi Bijoyata
                Im surprised about what you find with oheckman. As I said before, Oheckman is a generalization of the movestay command. So they should provide the same output, with rounding errors.
                But perhaps they way it was programmed simply has less stable conditions for the maximization.
                That being said. There is no clear suggestion, as far as I know, about how to correct for sample selection into each group when implementing oaxaca Decompositions.
                There is a discussion in Neuman and Oaxaca (2004) https://link.springer.com/article/10...28395.38694.4b
                The simplest approach is to elaborate the decomposition as a function of the selectivity corrected coefficients, excluding the selection term.
                In that case, you could do the following:

                Code:
                probit group x1 x2 x3
                predict imr, score
                oaxaca y x1 x2 x3, by(group) adjust(imr) w(0)
                This should adjust for IMR (the selection correction term, before doing the decomposition.
                HTH
                Fernando

                Comment


                • #9
                  Thank you Fernando. Will try and let you know.

                  Comment


                  • #10
                    Hi Fernando,
                    I did run the above command and
                    oaxaca LgWg Rural1 NeverMarried1 TechEdu1 YearsOfSchooling SocialGrp1 SocialGrp2 SocialGrp3 Relign1 Relign2 Age, by(Female1) adjust(imr) w(0)

                    adjust(): imr not found in models
                    r(111);
                    Then I used imr as one of the regressor after which I got the following result:

                    oaxaca LgWg Rural1 NeverMarried1 TechEdu1 YearsOfSchooling SocialGrp1 SocialGrp2 SocialGrp3 Relign1 Relign2 Age imr, by(Female1) adjust(imr) w(0)

                    Blinder-Oaxaca decomposition Number of obs = 84,279
                    Model = linear
                    Group 1: Female1 = 0 N of obs 1 = 63988
                    Group 2: Female1 = 1 N of obs 2 = 20291
                    LgWg Coef. Std. Err. z P>z [95% Conf. Interval]
                    overall
                    group_1 4.526128 .003349 1351.48 0.000 4.519564 4.532692
                    group_2 3.882628 .0063409 612.31 0.000 3.8702 3.895056
                    difference .6435 .007171 89.74 0.000 .629445 .6575549
                    adjusted
                    group_1 3.65692 .0608573 60.09 0.000 3.537642 3.776198
                    group_2 -8.936544 .8185817 -10.92 0.000 -10.54094 -7.332154
                    difference 12.59346 .8208408 15.34 0.000 10.98465 14.20228
                    explained -1.057167 .0827838 -12.77 0.000 -1.21942 -.8949137
                    unexplained 13.65063 .9015892 15.14 0.000 11.88355 15.41771
                    explained
                    Rural1 .0174847 .0013835 12.64 0.000 .014773 .0201964
                    NeverMarried1 -.1560421 .0118881 -13.13 0.000 -.1793424 -.1327418
                    TechEdu1 .0374981 .0054727 6.85 0.000 .0267718 .0482244
                    YearsOfSchooling -.7378792 .0620924 -11.88 0.000 -.859578 -.6161804
                    SocialGrp1 -.0178812 .0020675 -8.65 0.000 -.0219334 -.013829
                    SocialGrp2 .0121051 .0015508 7.81 0.000 .0090657 .0151445
                    SocialGrp3 -.0046387 .0009473 -4.90 0.000 -.0064953 -.0027821
                    Relign1 -.2045997 .0150904 -13.56 0.000 -.2341762 -.1750231
                    Relign2 .0007131 .0015656 0.46 0.649 -.0023553 .0037816
                    Age -.0039271 .0043378 -0.91 0.365 -.0124291 .0045748
                    unexplained
                    Rural1 .072083 .0077662 9.28 0.000 .0568615 .0873046
                    NeverMarried1 .599324 .0345889 17.33 0.000 .5315311 .6671169
                    TechEdu1 -.1809348 .0105748 -17.11 0.000 -.2016612 -.1602085
                    YearsOfSchooling 3.050308 .1807955 16.87 0.000 2.695956 3.404661
                    SocialGrp1 -.0926602 .0049768 -18.62 0.000 -.1024146 -.0829059
                    SocialGrp2 .0611215 .005582 10.95 0.000 .050181 .0720621
                    SocialGrp3 -.1291391 .0088536 -14.59 0.000 -.1464918 -.1117863
                    Relign1 .4689542 .0275437 17.03 0.000 .4149695 .522939
                    Relign2 -.0432731 .0034984 -12.37 0.000 -.0501297 -.0364164
                    Age 2.400971 .1238874 19.38 0.000 2.158156 2.643785
                    _cons 7.443877 .5650106 13.17 0.000 6.336477 8.551278
                    (adjusted by imr)
                    Thank you

                    Comment


                    • #11
                      Hi Bijoyata
                      I just look at your results, and It seems odd to me that you are now finding that the expected wage of women is negative! (well, almost zero).
                      Something I didnt ask. How are you defining your probit. Is "female=1" your dependent variable? Or is it "earn high wages"? I think that the IMR will have to be adjusted, depending on what type of selection you are trying to account for here.
                      Best
                      Fernando

                      Comment


                      • #12
                        Hi Fernando,
                        Thank you for noticing the odd result. Yes I have taken female=1 n my probit function.
                        probit Female1 Rural1 NeverMarried1 TechEdu1 YearsOfSchooling SocialGrp1 SocialGrp2 SocialGrp3 Relign1 Relign2 Age

                        Iteration 0: log likelihood = -46528.897
                        Iteration 1: log likelihood = -44490.64
                        Iteration 2: log likelihood = -44478.906
                        Iteration 3: log likelihood = -44478.903

                        Probit regression Number of obs = 84,293
                        LR chi2(10) = 4099.99
                        Prob > chi2 = 0.0000
                        Log likelihood = -44478.903 Pseudo R2 = 0.0441

                        ----------------------------------------------------------------------------------
                        Female1 | Coef. Std. Err. z P>|z| [95% Conf. Interval]
                        -----------------+----------------------------------------------------------------
                        Rural1 | -.0161325 .0103094 -1.56 0.118 -.0363387 .0040736
                        NeverMarried1 | -.280515 .0146186 -19.19 0.000 -.309167 -.251863
                        TechEdu1 | .2913284 .0219962 13.24 0.000 .2482167 .3344401
                        YearsOfSchooling | -.0513405 .001036 -49.56 0.000 -.0533709 -.04931
                        SocialGrp1 | .0710058 .0173734 4.09 0.000 .0369546 .1050571
                        SocialGrp2 | -.0406757 .0148374 -2.74 0.006 -.0697564 -.011595
                        SocialGrp3 | .0408341 .0128577 3.18 0.001 .0156334 .0660348
                        Relign1 | -.4472978 .0185717 -24.08 0.000 -.4836977 -.4108979
                        Relign2 | .0486743 .0164405 2.96 0.003 .0164515 .0808972
                        Age | -.0069367 .0004892 -14.18 0.000 -.0078955 -.0059778
                        _cons | -.088205 .0245496 -3.59 0.000 -.1363214 -.0400886
                        ----------------------------------------------------------------------------------

                        Comment


                        • #13
                          Hi Fernando,
                          the probit fuction imr is giving me the same doubtful result, since I had ready ran movestay command and realised that even with movestay command I can estimate imr (mills ratio) for both regimes with mspredict.. varname, imr1 and mspredict varname, imr2 command. Would it be correct to use these mills ratio as my selectivity correction term?
                          When I used these imr I got an explainable result, but the results are different for each one. What difference will be in my result by using the imr for regime 1 and imr for regime ?.

                          Comment


                          • #14
                            why movestay command result is not convergent?

                            Comment

                            Working...
                            X