Announcement

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

  • Margins in ordered probit

    Hi,

    I have run an ordered probit model. The dependent variable has 5 categories. I would like to run full marginal effects for all the exlanatory variables. I had successfuly done this using the old mfx command but ran into some problems as the file crashed due to a variable having missing values. I checked and there were no missing values. I then tried to rescale the variable and thata didn't work either. I found out that the mfx command is quite outdated and that I should use margins given that I am working on stata 15. I used the command:

    Code:
    margins, dydx(*) predict(outcome(1))
    i was met with the error

    Code:
    variable _cut1 not found
    r(111);
    any idea what I am doing wrong here?

  • #2
    Welcome to the Stata Forum / Statalist,

    I can reproduce the correct output with the command you shared.

    Since you didn't share data neither the - oprobit - command, maybe this error message is related to some issue before - margins - command.
    Best regards,

    Marcos

    Comment


    • #3
      I can't share the data. The oprobit command is really quite simple so I don't know what can really be gained from posting it.

      The only thing I noticed from the output of the oprobit before running the margins is that the cut point portion of the output looks as follows:


      _cut1 .7017347 .3066297 (Ancillary parameters)
      _cut2 2.404648 .306769
      _cut3 3.132685 .3069722
      _cut4 3.548914 .3073141


      is the (Ancillary parameters) and the fact the confidence intervals are missing a potential issue?

      Comment


      • #4
        I guess so. Hopefully you'll get further advice.
        Best regards,

        Marcos

        Comment


        • #5
          I find it quite odd that you are getting this error, but as Marcos notes we aren't seeing the commands and output that preceded it. I would make sure Stata is up to date:

          Code:
          update all
          The following handout may be helpful to you:

          https://www3.nd.edu/~rwilliam/stats3/Margins05.pdf

          If you want more background on margins, see

          https://www3.nd.edu/~rwilliam/stats3/index.html
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

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

          Comment


          • #6
            Added in edit: this crossed with posts 3, 4, and 5. Let me add that I really don't know why you decline to share your command and its output. If you like, change the variable names if you are concerned about revealing results.

            Let me join Marcos's welcome and add to his good advice by showing a working example of margins following ologit. Similar output from your work, presented as you did in post #1 using code delimiters, would help us better understand your problem.
            Code:
            . sysuse auto, clear
            (1978 Automobile Data)
            
            . ologit rep78 price mpg
            
            Iteration 0:   log likelihood = -93.692061  
            Iteration 1:   log likelihood = -85.262776  
            Iteration 2:   log likelihood = -84.953224  
            Iteration 3:   log likelihood = -84.952083  
            Iteration 4:   log likelihood = -84.952083  
            
            Ordered logistic regression                     Number of obs     =         69
                                                            LR chi2(2)        =      17.48
                                                            Prob > chi2       =     0.0002
            Log likelihood = -84.952083                     Pseudo R2         =     0.0933
            
            ------------------------------------------------------------------------------
                   rep78 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                   price |   .0001703   .0000937     1.82   0.069    -.0000134    .0003539
                     mpg |   .2023714   .0522594     3.87   0.000     .0999449    .3047978
            -------------+----------------------------------------------------------------
                   /cut1 |   1.517716   1.562458                     -1.544646    4.580077
                   /cut2 |   3.293126   1.444643                      .4616777    6.124575
                   /cut3 |   5.648905   1.513628                      2.682248    8.615562
                   /cut4 |   7.336082   1.638222                      4.125227    10.54694
            ------------------------------------------------------------------------------
            
            . margins, dydx(*) predict(outcome(1))
            
            Average marginal effects                        Number of obs     =         69
            Model VCE    : OIM
            
            Expression   : Pr(rep78==1), predict(outcome(1))
            dy/dx w.r.t. : price mpg
            
            ------------------------------------------------------------------------------
                         |            Delta-method
                         |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                   price |  -4.92e-06   4.27e-06    -1.15   0.250    -.0000133    3.46e-06
                     mpg |  -.0058436   .0042243    -1.38   0.167    -.0141231    .0024359
            ------------------------------------------------------------------------------
            
            . about
            
            Stata/SE 15.1 for Mac (64-bit Intel)
            Revision 06 Jun 2018
            Last edited by William Lisowski; 26 Jun 2018, 06:34.

            Comment


            • #7
              Let me add one more piece of advice. Please try running the exact code I ran in post #6.
              Code:
              sysuse auto, clear
              ologit rep78 price mpg
              margins, dydx(*) predict(outcome(1))
              about
              I am concerned that your installation of Stata 15 is faulty, because the _cut notation is, if I understand correctly, old notation superseded in Stata 15. It would be good to see if this simple example also fails - that would suggest the problem is not your model.

              I also continue to encourage you to share your ologit command and its full output. Would you ask your mechanic why your car doesn't start when you turn the key, but not allow the hood to be opened? What you ask of us is no different. We can't give a give a good answer if you can't supply a good description.

              Comment


              • #8
                Hi, thanks for your advice and comments.

                Below is the command and the code. Apologies for before. I was reluctant to post this because of the size of the output.

                Code:
                oprobit ordered_wages ucas_301350_rus_first ucas_351400_rus_first ucas_401450_rus_first ///
                 ucas_451500_rus_first ucas_501550_rus_first ucas_551600_rus_first ucas_601650_rus_first ucas_651700_rus_first ///
                 ucas_ov700_rus_first ucas_301350_rus_21 ucas_351400_rus_21 ucas_401450_rus_21 ucas_451500_rus_21 ucas_501550_rus_21 ///
                 ucas_551600_rus_21 ucas_601650_rus_21 ucas_651700_rus_21 ucas_ov700_rus_21 ucas_301350_rus_lt21 ///
                 ucas_351400_rus_lt21 ucas_401450_rus_lt21 ucas_451500_rus_lt21 ucas_501550_rus_lt21 ucas_551600_rus_lt21 ucas_601650_rus_lt21 ///
                 ucas_651700_rus_lt21 ucas_ov700_rus_lt21 ucas_301350_pre_first ucas_351400_pre_first ucas_401450_pre_first ///
                 ucas_451500_pre_first ucas_501550_pre_first ucas_551600_pre_first ucas_601650_pre_first ucas_651700_pre_first ///
                 ucas_ov700_pre_first ucas_301350_pre_21 ucas_351400_pre_21 ucas_401450_pre_21 ucas_451500_pre_21 ucas_501550_pre_21 ///
                 ucas_551600_pre_21 ucas_601650_pre_21 ucas_651700_pre_21 ucas_ov700_pre_21 ucas_301350_pre_lt21 ///
                 ucas_351400_pre_lt21 ucas_401450_pre_lt21 ucas_451500_pre_lt21 ucas_501550_pre_lt21 ucas_551600_pre_lt21 ucas_601650_pre_lt21 ///
                 ucas_651700_pre_lt21 ucas_ov700_pre_lt21 ucas_301350_post_first ucas_351400_post_first ucas_401450_post_first ///
                 ucas_451500_post_first ucas_501550_post_first ucas_551600_post_first ucas_601650_post_first ucas_651700_post_first ///
                 ucas_ov700_post_first ucas_301350_post_21 ucas_351400_post_21 ucas_401450_post_21 ucas_451500_post_21 ucas_501550_post_21 ///
                 ucas_551600_post_21 ucas_601650_post_21 ucas_651700_post_21 ucas_ov700_post_21 ucas_301350_post_lt21 ///
                 ucas_351400_post_lt21 ucas_401450_post_lt21 ucas_451500_post_lt21 ucas_501550_post_lt21 ucas_551600_post_lt21 ucas_601650_post_lt21 ///
                 ucas_651700_post_lt21 ucas_ov700_post_lt21 northern_ireland scotland wales english_welsh ///
                 bio vet agriculture physical_science maths computer_science engineering architecture social_science ///
                 law business communication languages history arts education ///
                 medium low home male professionals associate_professional administrative ///
                 skilled_trade leisure sales process_ops elementary y10_11 y11_12 y12_13 y13_14 y14_15
                
                
                Iteration 0:   log likelihood = -55075.016
                Iteration 1:   log likelihood = -47350.192
                Iteration 2:   log likelihood = -47083.738
                Iteration 3:   log likelihood = -47078.825
                Iteration 4:   log likelihood = -47078.818
                
                Ordered probit estimates                          Number of obs   =      57650
                                                                  LR chi2(118)    =   15992.40
                                                                  Prob > chi2     =     0.0000
                Log likelihood = -47078.818                       Pseudo R2       =     0.1452
                
                ------------------------------------------------------------------------------
                ordered_wa~s |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                -------------+----------------------------------------------------------------
                ucas_30135.. |   .3263828   .0634173     5.15   0.000     .2020871    .4506785
                ucas_35140.. |    .331345   .0486558     6.81   0.000     .2359814    .4267085
                ucas_40145.. |   .4714409    .045475    10.37   0.000     .3823115    .5605704
                ucas_45150.. |   .4914019   .0476059    10.32   0.000     .3980961    .5847077
                ucas_50155.. |   .4190666   .0538808     7.78   0.000     .3134621     .524671
                ucas_55160.. |    .621299   .0596814    10.41   0.000     .5043257    .7382724
                ucas_60165.. |   .8556928   .0854617    10.01   0.000     .6881909    1.023195
                ucas_65170.. |   .9012101   .1157188     7.79   0.000     .6744054    1.128015
                ucas_ov700.. |   1.155752   .1207081     9.57   0.000     .9191687    1.392336
                ucas_30~s_21 |   .1524609    .036307     4.20   0.000     .0813005    .2236212
                ucas_35~s_21 |   .2348411   .0304841     7.70   0.000     .1750933    .2945888
                ucas_40~s_21 |   .3126262    .031789     9.83   0.000      .250321    .3749315
                ucas_45~s_21 |   .3695539   .0348407    10.61   0.000     .3012674    .4378404
                ucas_50~s_21 |    .421901   .0440725     9.57   0.000     .3355206    .5082814
                ucas_55~s_21 |   .4922021    .053054     9.28   0.000     .3882182    .5961859
                ucas_60~s_21 |    .625557   .0784541     7.97   0.000     .4717897    .7793242
                ucas_65~s_21 |   .7014714   .1002809     7.00   0.000     .5049244    .8980183
                ucas_ov~s_21 |   .8960508   .1069324     8.38   0.000     .6864671    1.105634
                ucas_30135.. |   .0527754   .0676779     0.78   0.436    -.0798709    .1854216
                ucas_35140.. |   .0241196   .0658675     0.37   0.714    -.1049783    .1532176
                ucas_40145.. |    .165046   .0775303     2.13   0.033     .0130893    .3170027
                ucas_45150.. |   .1741328   .0908439     1.92   0.055    -.0039179    .3521835
                ucas_50155.. |   .2089935   .1137238     1.84   0.066     -.013901     .431888
                ucas_55160.. |   .3103819   .1369277     2.27   0.023     .0420086    .5787552
                ucas_60165.. |   .4834466   .1962175     2.46   0.014     .0988674    .8680259
                ucas_65170.. |   .6329983   .2168656     2.92   0.004     .2079495    1.058047
                ucas_ov700.. |   .6514624   .3012708     2.16   0.031     .0609825    1.241942
                ucas_30135.. |   .3421943   .0501718     6.82   0.000     .2438594    .4405293
                ucas_35140.. |   .3106942   .0448273     6.93   0.000     .2228344    .3985541
                ucas_40145.. |   .2979506   .0491063     6.07   0.000      .201704    .3941973
                ucas_45150.. |   .5020266    .055442     9.05   0.000     .3933623    .6106909
                ucas_50155.. |   .3918605    .071509     5.48   0.000     .2517055    .5320154
                ucas_55160.. |     .42912   .0915232     4.69   0.000     .2497379    .6085021
                ucas_60165.. |   .5937823   .1203956     4.93   0.000     .3578113    .8297533
                ucas_65170.. |   .3778746   .1524787     2.48   0.013     .0790218    .6767274
                ucas_ov700.. |    1.35292   .2327564     5.81   0.000     .8967259    1.809114
                ucas_30~e_21 |   .0613918   .0328645     1.87   0.062    -.0030215    .1258051
                ucas_35~e_21 |   .1227823   .0314799     3.90   0.000     .0610828    .1844818
                ucas_40~e_21 |   .1151287   .0368383     3.13   0.002     .0429269    .1873305
                ucas_45~e_21 |   .0982129   .0455294     2.16   0.031      .008977    .1874489
                ucas_50~e_21 |   .2855016   .0663638     4.30   0.000      .155431    .4155722
                ucas_55~e_21 |    .262395   .0840414     3.12   0.002     .0976769     .427113
                ucas_60~e_21 |   .4773434   .1282424     3.72   0.000     .2259929    .7286939
                ucas_65~e_21 |   .3288739   .1915335     1.72   0.086    -.0465249    .7042726
                ucas_ov~e_21 |   .1700734   .2079349     0.82   0.413    -.2374715    .5776183
                ucas_30135.. |  -.0774018   .0618627    -1.25   0.211    -.1986504    .0438469
                ucas_35140.. |   .0460456   .0668385     0.69   0.491    -.0849554    .1770465
                ucas_40145.. |   .1120524   .0897677     1.25   0.212    -.0638891    .2879938
                ucas_45150.. |    -.01818   .1271914    -0.14   0.886    -.2674705    .2311106
                ucas_50155.. |  -.3713419   .1750122    -2.12   0.034    -.7143595   -.0283244
                ucas_55160.. |   .1249259   .2490536     0.50   0.616    -.3632102    .6130619
                ucas_60165.. |   .2753485   .3661189     0.75   0.452    -.4422313    .9929282
                ucas_65170.. |   .3910783   .3696324     1.06   0.290    -.3333879    1.115544
                ucas_ov700.. |    .669843   .4130855     1.62   0.105    -.1397897    1.479476
                ucas_30135.. |   .1366616   .0304609     4.49   0.000     .0769592    .1963639
                ucas_35140.. |   .1473059   .0319083     4.62   0.000     .0847668    .2098451
                ucas_40145.. |   .2064044   .0369418     5.59   0.000     .1339997     .278809
                ucas_45150.. |   .2453339   .0435006     5.64   0.000     .1600743    .3305935
                ucas_50155.. |   .3955755   .0556387     7.11   0.000     .2865258    .5046253
                ucas_55160.. |   .5182459   .0695943     7.45   0.000     .3818435    .6546483
                ucas_60165.. |   .7129005   .0954899     7.47   0.000     .5257437    .9000572
                ucas_65170.. |   .7284083   .1165292     6.25   0.000     .5000152    .9568013
                ucas_ov700.. |   .9418191   .1203601     7.83   0.000     .7059175    1.177721
                ucas_30~t_21 |  -.0231639   .0224266    -1.03   0.302    -.0671192    .0207914
                ucas_35~t_21 |   .0311022    .023959     1.30   0.194    -.0158566     .078061
                ucas_40~t_21 |   .0912356   .0296006     3.08   0.002     .0332195    .1492517
                ucas_45~t_21 |   .1210562   .0359234     3.37   0.001     .0506475    .1914648
                ucas_50~t_21 |   .1083889   .0514639     2.11   0.035     .0075214    .2092564
                ucas_55~t_21 |   .2856297   .0628193     4.55   0.000     .1625062    .4087532
                ucas_60~t_21 |   .3518041   .0926311     3.80   0.000     .1702506    .5333576
                ucas_65~t_21 |   .5010633   .1217205     4.12   0.000     .2624955    .7396312
                ucas_ov~t_21 |   .7741985   .1240597     6.24   0.000     .5310459    1.017351
                ucas_30135.. |   -.117757   .0398804    -2.95   0.003    -.1959211   -.0395929
                ucas_35140.. |  -.0534828   .0485829    -1.10   0.271    -.1487035    .0417379
                ucas_40145.. |  -.0178175   .0703054    -0.25   0.800    -.1556136    .1199787
                ucas_45150.. |   .0990359     .09717     1.02   0.308    -.0914138    .2894856
                ucas_50155.. |  -.0058363   .1527856    -0.04   0.970    -.3052905     .293618
                ucas_55160.. |   .0551872   .1912546     0.29   0.773    -.3196648    .4300393
                ucas_60165.. |   .2706252    .250922     1.08   0.281    -.2211728    .7624232
                ucas_65170.. |   .7303166   .2790357     2.62   0.009     .1834167    1.277216
                ucas_ov700.. |   .5911629   .3325998     1.78   0.076    -.0607208    1.243047
                northern_i~d |  -.0718035   .0494959    -1.45   0.147    -.1688137    .0252068
                    scotland |   .2106679   .0123581    17.05   0.000     .1864465    .2348894
                       wales |  -.2540201   .0300324    -8.46   0.000    -.3128825   -.1951577
                english_we~h |   -.037112   .0295406    -1.26   0.209    -.0950104    .0207864
                         bio |  -.0539572   .0480053    -1.12   0.261    -.1480458    .0401314
                         vet |  -.0645865   .1342074    -0.48   0.630    -.3276281    .1984551
                 agriculture |   .1083124   .0709985     1.53   0.127    -.0308421    .2474669
                physical_s~e |   .0778811   .0500121     1.56   0.119    -.0201407    .1759029
                       maths |   .2307862   .0536505     4.30   0.000     .1256332    .3359391
                computer_s~e |   .1496123   .0521936     2.87   0.004     .0473146    .2519099
                 engineering |    .218228   .0501657     4.35   0.000      .119905    .3165509
                architecture |  -.0299511    .057267    -0.52   0.601    -.1421923    .0822901
                social_sci~e |   .2253803   .0477364     4.72   0.000     .1318187    .3189419
                         law |   -.011798   .0517059    -0.23   0.820    -.1131396    .0895437
                    business |   .1779843   .0480497     3.70   0.000     .0838087      .27216
                communicat~n |  -.0738009     .05296    -1.39   0.163    -.1776006    .0299987
                   languages |  -.0913278   .0492175    -1.86   0.064    -.1877924    .0051368
                     history |   -.038365   .0498631    -0.77   0.442    -.1360949    .0593649
                        arts |  -.0230224   .0487249    -0.47   0.637    -.1185213    .0724766
                   education |   .3413238   .0509456     6.70   0.000     .2414723    .4411754
                      medium |  -.0304022   .0156108    -1.95   0.051    -.0609988    .0001945
                         low |  -.0501582   .0219704    -2.28   0.022    -.0932194   -.0070969
                        home |   -.013718   .0132805    -1.03   0.302    -.0397472    .0123112
                        male |   .1295786     .01095    11.83   0.000     .1081171    .1510401
                profession~s |  -.0032341    .024998    -0.13   0.897    -.0522292     .045761
                associate_~l |  -.3824139   .0247835   -15.43   0.000    -.4309887   -.3338392
                administra~e |  -1.245629   .0304474   -40.91   0.000    -1.305305   -1.185954
                skilled_tr~e |  -1.177084   .0684821   -17.19   0.000    -1.311307   -1.042862
                     leisure |   -1.92423   .0429308   -44.82   0.000    -2.008373   -1.840088
                       sales |  -1.705682   .0379353   -44.96   0.000    -1.780034    -1.63133
                 process_ops |  -1.123409   .1098573   -10.23   0.000    -1.338726   -.9080929
                  elementary |  -2.048679   .0566534   -36.16   0.000    -2.159718    -1.93764
                      y10_11 |   .8946141   .3026295     2.96   0.003     .3014711    1.487757
                      y11_12 |   .9841614   .3025815     3.25   0.001     .3911126     1.57721
                      y12_13 |   .8579464    .302648     2.83   0.005     .2647672    1.451126
                      y13_14 |   .8557054   .3333541     2.57   0.010     .2023434    1.509067
                      y14_15 |   .4967377   .3457946     1.44   0.151    -.1810073    1.174483
                -------------+----------------------------------------------------------------
                       _cut1 |   .7017347   .3066297          (Ancillary parameters)
                       _cut2 |   2.404648    .306769
                       _cut3 |   3.132685   .3069722
                       _cut4 |   3.548914   .3073141
                ------------------------------------------------------------------------------
                
                .  
                .  margins, dydx(*) predict(outcome(1))
                variable _cut1 not found
                r(111);
                working on trying to get STATA updated so I will see if that makes any difference.

                Comment


                • #9
                  Thank you. The extensive output is helpful, and we're not charged by the byte posted, so don't be hesitant when asked for output.

                  I apologize for misreading your post #1 and thinking you were using ologit - that's what I'm currently focused on in my work, and it clearly crowded out what you wrote. However, substituting oprobit for ologit throughout everything I've written thus far does not affect the essence. In particular, when I run the code in post #7 using oprobit, the results are not substantively different. In particular, the cuts are again identified by /cut1 etc. rather than _cut1 etc. as in your output. That difference concerns me greatly.

                  Your output also leads me to a separate comment that will be relevant when you get margins working. It seems to me that some (many? most?) variables in your equation may be indicator (0/1) variables generated from categorical (1/2/3/...) variables. For example, I see variables "medium" and "low", and expect that "high" was your omitted category, for a high/medium/low categorical variable.

                  If that is the case, the margins command you show will give misleading results. You should instead be using the "factor variable" technique for including categorical variables in your model. You will find the notation for factor variables a powerful tool in your work. If you are not already familiar with them, do read the output of help factor variables and section 11.4.3 of the Stata User's Guide PDF included with your Stata installation and accessible from Stata's Help menu. Your effort will be amply repaid.

                  At a high level, the problem with using manually generated dummy variables is that it hides from Stata the fact that if low is 1 and medium is 0, and the value of medium is changed from 0 to 1, low must also change from 1 to 0. That is, the calculated partial derivatives will be incorrect.

                  That's as much as I can easily say. My hope is that Richard Williams will return to this topic and elucidate further. I will confirm his recommendation of his course notes; they are the best way to learn about margins and Stata's margins command. I recommend them whenever someone new to margins asks a question here.

                  Comment


                  • #10
                    This does NOT look like Stata 15 output. You should make sure Stata is up to date. Or, Have you previously issued a version command, e.g.

                    version 12

                    That would give you throwback formatting, which you don't want.

                    Like William, I suspect you are generating zillions of dummies yourself when you should be using factor variable notation. Take a look at

                    https://www3.nd.edu/~rwilliam/stats3/Margins01.pdf

                    Also, with Stata 15, you shouldn't need the predict(outcome) part of the margins commands. All outcomes will be done for you.

                    In short, while I suspect your coding is flawed, I still don't think you should be getting the errors that you are. Get your Stata up to date. It may or may not solve your problems. But the first thing I do when I have a problem is make sure all software is up to date. If you are lucky, the problem may have been already fixed.
                    -------------------------------------------
                    Richard Williams, Notre Dame Dept of Sociology
                    StataNow Version: 19.5 MP (2 processor)

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

                    Comment


                    • #11
                      Thanks for your input Richard. It is indeed Stata 15/SE and it was just updated. Thanks to both of you for the help regarding factor variables. I am updating the data just now so that the variables are properly coded. Maybe that will help

                      Comment


                      • #12
                        I believe this is not the cause of the error message, but the cornucopia of predictors striked me as odd. Not only in terms in rending it tough to get a glimpse, but concerning the lack of parsimony as well. Maybe it is an exploratory estimation, or a regular procedure in a given field, who knows. Personally, I have never needed to include so many predictors. What is more, to avoid overfitting “, I’d take several precautions, I mean, who knows whether a parsimonious model isn’ as good as the full one...
                        Best regards,

                        Marcos

                        Comment


                        • #13
                          ok I changed the large among of dummy variables to factor variables. The oprobit command is now:

                          Code:
                          ordered_wages b(first).ucas_points#institution#degree_class ib(first).degree_subject male home ib(3).social_class ib(9).profession ib(3).domicile_country ib(last).year
                          I managed to get the oprobit running fine,and it provided the following output

                          Code:
                          Iteration 0:   log likelihood = -48729.808  
                          Iteration 1:   log likelihood = -41830.417  
                          Iteration 2:   log likelihood = -41714.749  
                          Iteration 3:   log likelihood = -41714.263  
                          Iteration 4:   log likelihood = -41714.263  
                          
                          Ordered probit regression                       Number of obs     =     50,845
                                                                          LR chi2(80)       =   14031.09
                                                                          Prob > chi2       =     0.0000
                          Log likelihood = -41714.263                     Pseudo R2         =     0.1440
                          
                          ------------------------------------------------------------------------------------------------------
                                                 ordered_wages |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                          -------------------------------------+----------------------------------------------------------------
                          ucas_points#institution#degree_class |
                                                        1 1 2  |    .122025   .0284822     4.28   0.000     .0662009    .1778491
                                                        1 1 3  |   .2945099   .0328385     8.97   0.000     .2301477    .3588722
                                                        1 2 1  |   .0258171   .0520987     0.50   0.620    -.0762944    .1279286
                                                        1 2 2  |   .1844349   .0352262     5.24   0.000     .1153928    .2534771
                                                        1 2 3  |   .4468149   .0481428     9.28   0.000     .3524567    .5411731
                                                        1 3 1  |    .154422   .0570829     2.71   0.007     .0425417    .2663024
                                                        1 3 2  |   .2685957   .0381465     7.04   0.000       .19383    .3433615
                                                        1 3 3  |   .4853598   .0557695     8.70   0.000     .3760536    .5946661
                                                        2 1 1  |   .1136818   .0492878     2.31   0.021     .0170795    .2102842
                                                        2 1 2  |   .2072657   .0309454     6.70   0.000     .1466139    .2679176
                                                        2 1 3  |   .3312658   .0351543     9.42   0.000     .2623646     .400167
                                                        2 2 1  |   .2000863   .0621029     3.22   0.001     .0783668    .3218058
                                                        2 2 2  |   .2767015   .0346996     7.97   0.000     .2086914    .3447115
                                                        2 2 3  |   .4611747   .0422792    10.91   0.000     .3783089    .5440405
                                                        2 3 1  |   .2272052   .0581598     3.91   0.000     .1132142    .3411963
                                                        2 3 2  |   .4277348    .033344    12.83   0.000     .3623818    .4930879
                                                        2 3 3  |   .5542911   .0421121    13.16   0.000     .4717529    .6368293
                                                        3 1 1  |   .2104986   .0914713     2.30   0.021     .0312181    .3897792
                                                        3 1 2  |   .2578483   .0397414     6.49   0.000     .1799567      .33574
                                                        3 1 3  |   .4603055   .0440395    10.45   0.000     .3739897    .5466214
                                                        3 2 1  |  -.0104366   .1095388    -0.10   0.924    -.2251288    .2042555
                                                        3 2 2  |   .3226093   .0461597     6.99   0.000     .2321379    .4130807
                                                        3 2 3  |   .6167367   .0519022    11.88   0.000     .5150102    .7184632
                                                        3 3 1  |   .3424098   .0771889     4.44   0.000     .1911224    .4936973
                                                        3 3 2  |   .5283255   .0373337    14.15   0.000     .4551529    .6014982
                                                        3 3 3  |   .6053861   .0442785    13.67   0.000     .5186018    .6921705
                                                        4 1 1  |   .2289559   .1709117     1.34   0.180     -.106025    .5639367
                                                        4 1 2  |   .4892278   .0607193     8.06   0.000     .3702202    .6082353
                                                        4 1 3  |   .7202789   .0661314    10.89   0.000     .5906637    .8498941
                                                        4 2 1  |   .3202528   .2132476     1.50   0.133    -.0977047    .7382103
                                                        4 2 2  |   .5121867   .0771919     6.64   0.000     .3608934      .66348
                                                        4 2 3  |   .6904539   .0812425     8.50   0.000     .5312214    .8496863
                                                        4 3 1  |    .439903   .1204399     3.65   0.000     .2038451    .6759609
                                                        4 3 2  |   .6804744   .0516014    13.19   0.000     .5793375    .7816114
                                                        4 3 3  |   .8658012   .0558739    15.50   0.000     .7562904     .975312
                                                        5 1 1  |   .8464162   .2259459     3.75   0.000     .4035704    1.289262
                                                        5 1 2  |   .7772149   .0968406     8.03   0.000     .5874108    .9670191
                                                        5 1 3  |    1.03568   .0926342    11.18   0.000     .8541203     1.21724
                                                        5 2 1  |     .67642   .2843557     2.38   0.017     .1190932    1.233747
                                                        5 2 2  |   .3433564   .1526184     2.25   0.024     .0442298     .642483
                                                        5 2 3  |    .893844   .1388627     6.44   0.000     .6216781     1.16601
                                                        5 3 1  |    .839549   .1897515     4.42   0.000      .467643    1.211455
                                                        5 3 2  |   .9513574   .0788588    12.06   0.000      .796797    1.105918
                                                        5 3 3  |    1.16556    .090762    12.84   0.000     .9876695     1.34345
                                                               |
                                                degree_subject |
                                                            2  |  -.0466274   .0503753    -0.93   0.355    -.1453611    .0521064
                                                            3  |   .0117124   .1423842     0.08   0.934    -.2673556    .2907804
                                                            4  |    .139808   .0739726     1.89   0.059    -.0051756    .2847916
                                                            5  |   .0760401   .0523318     1.45   0.146    -.0265282    .1786085
                                                            6  |   .2215697   .0562129     3.94   0.000     .1113944     .331745
                                                            7  |   .1705236   .0550879     3.10   0.002     .0625534    .2784938
                                                            8  |   .2227721   .0525664     4.24   0.000      .119744    .3258003
                                                            9  |  -.0355895   .0601127    -0.59   0.554    -.1534083    .0822293
                                                           10  |   .2335204   .0500192     4.67   0.000     .1354846    .3315562
                                                           11  |   .0082208   .0544499     0.15   0.880     -.098499    .1149406
                                                           12  |   .1903922   .0505065     3.77   0.000     .0914012    .2893831
                                                           13  |  -.0656243   .0558085    -1.18   0.240    -.1750069    .0437583
                                                           14  |  -.0968079   .0514703    -1.88   0.060    -.1976878     .004072
                                                           15  |  -.0332252    .052119    -0.64   0.524    -.1353766    .0689262
                                                           16  |  -.0238721   .0512581    -0.47   0.641    -.1243362    .0765921
                                                           17  |   .3625369   .0537822     6.74   0.000     .2571257    .4679481
                                                               |
                                                          male |   .1324352   .0116234    11.39   0.000     .1096537    .1552166
                                                          home |  -.0070025   .0145357    -0.48   0.630     -.035492     .021487
                                                               |
                                                  social_class |
                                                            1  |  -.0541588   .0221856    -2.44   0.015    -.0976419   -.0106758
                                                            2  |  -.0356887   .0158322    -2.25   0.024    -.0667193    -.004658
                                                               |
                                                    profession |
                                                            1  |  -2.042568   .0609331   -33.52   0.000    -2.161995   -1.923142
                                                            2  |  -1.077261   .1172196    -9.19   0.000    -1.307007   -.8475148
                                                            3  |  -1.687673   .0405924   -41.58   0.000    -1.767233   -1.608114
                                                            4  |  -1.896372   .0454721   -41.70   0.000    -1.985496   -1.807249
                                                            5  |  -1.102676   .0717409   -15.37   0.000    -1.243285   -.9620662
                                                            6  |    -1.2363   .0324223   -38.13   0.000    -1.299847   -1.172753
                                                            7  |  -.3787539   .0263511   -14.37   0.000    -.4304011   -.3271066
                                                            8  |  -.0076876   .0265852    -0.29   0.772    -.0597937    .0444185
                                                               |
                                              domicile_country |
                                                            1  |  -.0663571   .0513973    -1.29   0.197    -.1670939    .0343797
                                                            2  |   .2105795   .0131891    15.97   0.000     .1847294    .2364296
                                                            4  |  -.2702296   .0319396    -8.46   0.000    -.3328301   -.2076292
                                                               |
                                                          year |
                                                           13  |   .8360674   .3069797     2.72   0.006     .2343982    1.437737
                                                           14  |   .9099453    .306941     2.96   0.003      .308352    1.511539
                                                           15  |   .7922296   .3069998     2.58   0.010     .1905211    1.393938
                                                           16  |   .7209004   .3446793     2.09   0.036     .0453414    1.396459
                                                           17  |   .3174108   .3599137     0.88   0.378    -.3880071    1.022829
                          -------------------------------------+----------------------------------------------------------------
                                                         /cut1 |   .8274543   .3108772                      .2181461    1.436762
                                                         /cut2 |   2.530027   .3110407                      1.920398    3.139655
                                                         /cut3 |   3.260181   .3112623                      2.650119    3.870244
                                                         /cut4 |   3.677116   .3116356                      3.066322    4.287911
                          ------------------------------------------------------------------------------------------------------
                          I then ran marginal effects using the command:

                          Code:
                          margins, dydx(*) predict(outcome(1))
                          I received the following output:

                          Code:
                          ---------------------------------------------------------------------------------
                                           |            Delta-method
                                           |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
                          -----------------+----------------------------------------------------------------
                               ucas_points |
                                        2  |  -.0295553   .0042808    -6.90   0.000    -.0379455    -.021165
                                        3  |  -.0533498   .0057696    -9.25   0.000     -.064658   -.0420417
                                        4  |  -.1141749   .0091941   -12.42   0.000     -.132195   -.0961548
                                        5  |  -.1892636   .0136379   -13.88   0.000    -.2159935   -.1625338
                                           |
                               institution |
                                        2  |  -.0228243   .0048992    -4.66   0.000    -.0324265   -.0132221
                                        3  |  -.0598555   .0051017   -11.73   0.000    -.0698546   -.0498564
                                           |
                              degree_class |
                                        2  |  -.0443302   .0058108    -7.63   0.000     -.055719   -.0329413
                                        3  |  -.1007121   .0063434   -15.88   0.000     -.113145   -.0882792
                                           |
                            degree_subject |
                                        2  |   .0153118    .016537     0.93   0.354    -.0171001    .0477237
                                        3  |  -.0038433   .0467141    -0.08   0.934    -.0954014    .0877147
                                        4  |  -.0456751   .0241141    -1.89   0.058     -.092938    .0015877
                                        5  |  -.0249087   .0171617    -1.45   0.147     -.058545    .0087276
                                        6  |   -.072042    .018326    -3.93   0.000    -.1079603   -.0361237
                                        7  |  -.0556199   .0180126    -3.09   0.002    -.0909239   -.0203158
                                        8  |  -.0724271   .0171814    -4.22   0.000    -.1061019   -.0387522
                                        9  |   .0116862   .0197357     0.59   0.554    -.0269951    .0503675
                                       10  |  -.0758653   .0163733    -4.63   0.000    -.1079564   -.0437741
                                       11  |  -.0026978   .0178697    -0.15   0.880    -.0377217    .0323261
                                       12  |  -.0620285   .0165409    -3.75   0.000     -.094448   -.0296089
                                       13  |   .0215515   .0183228     1.18   0.240    -.0143606    .0574636
                                       14  |   .0317899    .016896     1.88   0.060    -.0013257    .0649055
                                       15  |   .0109096    .017109     0.64   0.524    -.0226235    .0444427
                                       16  |   .0078377   .0168259     0.47   0.641    -.0251404    .0408159
                                       17  |  -.1165103    .017456    -6.67   0.000    -.1507235   -.0822971
                                           |
                                      male |  -.0426684   .0037346   -11.43   0.000    -.0499881   -.0353487
                                      home |   .0022561   .0046832     0.48   0.630    -.0069228    .0114349
                                           |
                              social_class |
                                        1  |   .0174808   .0071736     2.44   0.015     .0034209    .0315407
                                        2  |   .0115108   .0051121     2.25   0.024     .0014913    .0215304
                                           |
                                profession |
                                        1  |   .6144908   .0111477    55.12   0.000     .5926416      .63634
                                        2  |   .3956339   .0384962    10.28   0.000     .3201828    .4710851
                                        3  |   .5573366   .0107237    51.97   0.000     .5363186    .5783546
                                        4  |   .5940243   .0104524    56.83   0.000     .5735381    .6145106
                                        5  |   .4039022   .0233716    17.28   0.000     .3580948    .4497097
                                        6  |   .4453631   .0105762    42.11   0.000     .4246341    .4660921
                                        7  |   .1387828   .0091528    15.16   0.000     .1208436    .1567219
                                        8  |   .0026452   .0091351     0.29   0.772    -.0152593    .0205497
                                           |
                          domicile_country |
                                        1  |   .0215668   .0167251     1.29   0.197    -.0112138    .0543474
                                        2  |  -.0674758   .0041797   -16.14   0.000    -.0756678   -.0592837
                                        4  |   .0877562   .0102973     8.52   0.000     .0675738    .1079387
                                           |
                                      year |
                                       13  |  -.2574472   .0822449    -3.13   0.002    -.4186442   -.0962502
                                       14  |  -.2812545    .082226    -3.42   0.001    -.4424145   -.1200944
                                       15  |  -.2432494   .0822508    -2.96   0.003    -.4044581   -.0820407
                                       16  |  -.2200915   .0967303    -2.28   0.023    -.4096794   -.0305036
                                       17  |  -.0915577   .1003606    -0.91   0.362    -.2882608    .1051454
                          ----------------------------------------------------------------------------------
                          Note: dy/dx for factor levels is the discrete change from the base level.
                          The problem is that in the oprobit i have a three way interaction variable. When I run this through the marginal effects, it seems to ignore this an provide marginal effects for each variable individually (i.e. without the interaction variable used in the oprobit command). Any idea how to get the marginal effects to run based on the original oprobit command?

                          Comment


                          • #14
                            No, the interactions are accounted for. There is no separate marginal effect for an interaction term. See

                            https://www.stata.com/statalist/arch.../msg00293.html
                            -------------------------------------------
                            Richard Williams, Notre Dame Dept of Sociology
                            StataNow Version: 19.5 MP (2 processor)

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

                            Comment

                            Working...
                            X