Announcement

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

  • Using Constraints with Movestay command

    I want to test Lr test for endogenous switching regression equation (I have used movestay of this), where the constraint is "coefficient of the select equation equals the difference between the coefficients of the two segment equations".
    I tried to run the following command to get the constrained equation, so that i can run lrtest. But i get the following error. Could someone help me with this?

    **Command**
    constraint 1 [LogWage1_1] Female -[LogWage1_0] Female = [HighWg] Female
    constraint 2 [LogWage1_1] TechnicalEducation1 -[LogWage1_0] TechnicalEducation1 = [HighWg] TechnicalEducation1
    constraint 3 [LogWage1_1] NewReligion2 -[LogWage1_0] NewReligion2 = [HighWg] NewReligion2
    constraint 4 [LogWage1_1] NewReligion3 -[LogWage1_0] NewReligion3 = [HighWg] NewReligion3
    constraint 5 [LogWage1_1] SocialGroup1 -[LogWage1_0] SocialGroup1 = [HighWg] SocialGroup1
    constraint 6 [LogWage1_1] SocialGroup2 -[LogWage1_0] SocialGroup2 = [HighWg] SocialGroup2
    constraint 7 [LogWage1_1] SocialGroup3 -[LogWage1_0] SocialGroup3 = [HighWg] SocialGroup3
    movestay (LogWage1 Female Sector1 MaritialStatus1 YearsOfEducation TechnicalEducation1 NewReligion2 NewReligion3 SocialGroup1 SocialGroup2 SocialGroup3 Experience ExperienceSq ),select( HighWg Female Sector1 MaritialStatus1 YearsOfEducation TechnicalEducation1 NewReligion2 NewReligion3 SocialGroup1 SocialGroup2 SocialGroup3 Experience ExperienceSq) constraints(1/7)


    **The result**
    Fitting initial values .....Constraints invalid:
    LogWage1_1 not found
    r(111);

    The LogWage1_1, LogWage1_0 are the segment equations name I got in the result of the movestay command without constraints, while HighWg is the (binary) dependent variable of the switching/select equation.

  • #2
    Hi Bijoyata
    can you run the regression without the constraint, and show the output it produces? it may be that the "equation" name you are using is incorrect.
    In addition, I do not think the hypothesis you are testing is valid. Even if the selection term is capturing a latent wage difference between groups, the coefficients of that equation have a different scaled compared to the coefficients of your output equations.
    HTH
    Fernando

    Comment


    • #3
      Hi Fernando,

      Thank you. The following is the command and the result of the unconstrained model.

      COMMAND
      movestay (LogWage1 Age Female Sector1 MaritialStatus1 YearsOfEducation TechnicalEducation1 NewReligion2 NewReligion3 SocialGroup1 SocialGroup2 SocialGroup3 Experience ),select( HighWg Age Female Sector1 MaritialStatus1 YearsOfEducation TechnicalEducation1 NewReligion2 NewReligion3 SocialGroup1 SocialGroup2 SocialGroup3 Experience )

      RESULT
      note: YearsOfEducation dropped from the selection equation due to collinearity
      note: YearsOfEducation dropped from the first equation due to collinearity
      note: YearsOfEducation dropped from the first equation due to collinearity

      Fitting initial values .....
      Iteration 0: log likelihood = -134613.36 (not concave)
      Iteration 1: log likelihood = -93922.83 (not concave)
      Iteration 2: log likelihood = -74722.577 (not concave)
      Iteration 3: log likelihood = -69952.763 (not concave)
      Iteration 4: log likelihood = -63408.305 (not concave)
      Iteration 5: log likelihood = -61723.489 (not concave)
      Iteration 6: log likelihood = -60360.523 (not concave)
      Iteration 7: log likelihood = -59394.535 (not concave)
      Iteration 8: log likelihood = -58710.459 (not concave)
      Iteration 9: log likelihood = -58275.476 (not concave)
      Iteration 10: log likelihood = -57869.813 (not concave)
      Iteration 11: log likelihood = -56944.799
      Iteration 12: log likelihood = -56018.225
      Iteration 13: log likelihood = -55561.593
      Iteration 14: log likelihood = -55469.792
      Iteration 15: log likelihood = -55445.772
      Iteration 16: log likelihood = -55444.944
      Iteration 17: log likelihood = -55444.941

      Endogenous switching regression model Number of obs = 57453
      Wald chi2(11) = 27745.88
      Log likelihood = -55444.941 Prob > chi2 = 0.0000

      -------------------------------------------------------------------------------------
      | Coef. Std. Err. z P>|z| [95% Conf. Interval]
      --------------------+----------------------------------------------------------------
      LogWage1_1 |
      Age | .1063898 .0008001 132.97 0.000 .1048216 .107958
      Female | -.4075342 .008631 -47.22 0.000 -.4244507 -.3906178
      Sector1 | -.0973305 .0063016 -15.45 0.000 -.1096813 -.0849797
      MaritialStatus1 | -.1423215 .0094412 -15.07 0.000 -.1608259 -.1238172
      TechnicalEducation1 | .3141746 .0121099 25.94 0.000 .2904396 .3379096
      NewReligion2 | .0367471 .0097647 3.76 0.000 .0176087 .0558855
      NewReligion3 | .1773151 .0106585 16.64 0.000 .1564247 .1982055
      SocialGroup1 | .0312455 .0110577 2.83 0.005 .0095728 .0529181
      SocialGroup2 | -.0985965 .0095592 -10.31 0.000 -.1173322 -.0798607
      SocialGroup3 | -.1089048 .0075327 -14.46 0.000 -.1236686 -.094141
      Experience | -.0811808 .000694 -116.97 0.000 -.082541 -.0798205
      _cons | 3.984341 .0185128 215.22 0.000 3.948056 4.020625
      --------------------+----------------------------------------------------------------
      LogWage1_0 |
      Age | .0767631 .0007024 109.29 0.000 .0753865 .0781398
      Female | -.389492 .0064075 -60.79 0.000 -.4020505 -.3769335
      Sector1 | -.0805076 .0050049 -16.09 0.000 -.0903171 -.0706982
      MaritialStatus1 | -.1220436 .0072535 -16.83 0.000 -.1362602 -.1078269
      TechnicalEducation1 | .2716609 .0109668 24.77 0.000 .2501664 .2931555
      NewReligion2 | .0202259 .0076634 2.64 0.008 .005206 .0352458
      NewReligion3 | .1577168 .00865 18.23 0.000 .1407632 .1746705
      SocialGroup1 | .0109427 .0088967 1.23 0.219 -.0064946 .0283799
      SocialGroup2 | -.0874719 .0074954 -11.67 0.000 -.1021626 -.0727812
      SocialGroup3 | -.084714 .0060785 -13.94 0.000 -.0966277 -.0728004
      Experience | -.0594822 .0005846 -101.75 0.000 -.060628 -.0583364
      _cons | 4.379726 .014047 311.79 0.000 4.352194 4.407257
      --------------------+----------------------------------------------------------------
      HighWg |
      Age | .1524897 .0011861 128.57 0.000 .1501651 .1548144
      Female | -.5933742 .0121353 -48.90 0.000 -.6171589 -.5695895
      Sector1 | -.1378367 .0090804 -15.18 0.000 -.155634 -.1200395
      MaritialStatus1 | -.2087575 .0135512 -15.41 0.000 -.2353173 -.1821977
      TechnicalEducation1 | .455741 .0176481 25.82 0.000 .4211514 .4903306
      NewReligion2 | .0499378 .0140584 3.55 0.000 .0223838 .0774917
      NewReligion3 | .2550366 .0153496 16.62 0.000 .2249519 .2851214
      SocialGroup2 | -.1444617 .0137693 -10.49 0.000 -.1714489 -.1174744
      SocialGroup3 | -.1531464 .0108715 -14.09 0.000 -.1744543 -.1318386
      Experience | -.1165117 .0010148 -114.81 0.000 -.1185007 -.1145227
      SocialGroup1 | .0421585 .0159453 2.64 0.008 .0109063 .0734108
      _cons | -2.180766 .0260441 -83.73 0.000 -2.231811 -2.12972
      --------------------+----------------------------------------------------------------
      /lns1 | -.365468 .0048237 -75.76 0.000 -.3749223 -.3560137
      /lns2 | -.5774356 .0044615 -129.43 0.000 -.5861799 -.5686912
      /r1 | 5.530758 .0535429 103.30 0.000 5.425816 5.6357
      /r2 | 2.930544 .0337969 86.71 0.000 2.864303 2.996784
      -------------+----------------------------------------------------------------
      sigma_1 | .6938718 .003347 .6873427 .700463
      sigma_2 | .561336 .0025044 .5564489 .5662661
      rho_1 | .9999686 3.36e-06 .9999613 .9999745
      rho_2 | .9943199 .0003828 .9935179 .9950229
      ------------------------------------------------------------------------------
      LR test of indep. eqns. : chi2(1) = 9855.20 Prob > chi2 = 0.0000
      ------------------------------------------------------------------------------

      Comment


      • #4
        Ok, so what happens when you do something like:
        Code:
        test [LogWage1_1]Female -[LogWage1_0]Female = [HighWg]Female
        So, different from your first line, i erased the space between the brackets and the variable name.
        If this works, then maybe your constrains will work too.
        I also meant to ask you which version of movestay you are using. "which movestay". Mine is *! version 3.0.2 21Apr2008 M. Lokshin, Z. Sajaia
        And on this version, the auxiliary equation names were saved slightly differently. Perhaps constrains were not allowed in earlier versions either, which explains the problem you are facing.
        HTH


        Comment


        • #5
          Thank you for your kind reply.
          But doesn't the test command just check for the given coefficients and not for the entire model?

          As per your earlier reply (sorry had missed on that) "In addition, I do not think the hypothesis you are testing is valid. Even if the selection term is capturing a latent wage difference between groups, the coefficients of that equation have a different scaled compared to the coefficients of your output equations.", I was trying to follow the methodology developed by Dickens and Lang (1985) https://www.nber.org/papers/w1314. Tough Heckman (1986) has criticized this approach.

          VERSION of movestay
          I don't remember which version, the ado dir shows following
          [4] package movestay from http://fmwww.bc.edu/repec/bocode/m
          'MOVESTAY': module for maximum likelihood estimation of endogenous regression switching models

          [5] package st0071_2 from http://www.stata-journal.com/software/sj5-3
          SJ5-3 st0071_2. Maximum likelihood estimation of models...

          Comment


          • #6
            Hi Fernando,
            Yes it seems to be the space between that was giving the error. thanks a lot. The command is running now.

            Comment

            Working...
            X