Announcement

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

  • Multinomial Logit Regression - Again

    Hi all,

    I posted a similar question last week and someone very kindly helped me, but I have since had to change my dataset and so am back to square one. Using the data below, I am trying to run a multinomial logit regression. This table would display coefficients for a multinomial logit regression, examining the relationship between various target characteristics and the probability of a settlement or proxy vote versus neither outcome (‘neither’).

    The first column is supposed to examine the relationship between the variables and the probability of "settlement" vs the probability of the outcome "neither". The second column would examine the relationship with the probability of a proxy vote versus the outcome ‘neither’. The variable "campaign outcome", which has 1, 2, and 3 values represents settlement (1), proxy vote (2) and neither (3), and there are also independent variables representing this data, because I wasn't sure which would work best.

    I have organized all the data that I need, but when I input it into the "mlogit" function the way that seems right (it probably isn't), I get "no observations" as a result. Is there something obvious I am missing here?

    Things I am specifically confused about: how to include a "base outcome", and how to indicate a "predicted outcome". Also, I am not sure how it'll work with some of my variables categorical (the ones with 1 and 0 values, and the ones with 1, 2, 3 values), and some numerical. Do I have to indicate which variables are categorical?

    Thanks in advance - this is all new to me and this forum seems like a really great resource - I really appreciate any and all help as I need to get this done. I apologize for my ineptitude!!!


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input byte highactivistownership double(institutionalownership_num roa_num tobinsq_num marketcapquarterbeforeannouc_num abnormalreturnslongterm_num) byte(campaignoutcome_num settlement_num proxyvote_num) str1 neither
    0           46.428 .0800323362974939 1.261698440207972       58.7                 . 2 0 1 "0"
    0            7.031                 0 4.832146490335707     14.413 2.651471488866258 1 1 1 "0"
    0            32.01 .0833757421543681 .0339587242026266      163.9  .213369748791652 1 1 0 "0"
    1           23.826 .8795986622073579  .135846372688478     46.201  12.6241762186723 1 1 0 "0"
    0           26.819 .0752240717029449 .8598813327247833        944 .1878145784600815 1 1 0 "0"
    0           12.055                 0 1.038564721663313      355.3                 . 1 1 0 "0"
    0           67.088 .2022476291489893 .6055301759685684    15059.4                 . 2 0 1 "0"
    1           47.511 .0200777078109748 .0854037267080745    289.384 1.603584617311411 1 1 0 "0"
    0           55.908 .2481927710843374 .2826267664172901    127.273                 . 1 1 0 "0"
    0           39.685 .1652073732718894 .3162090345438441    128.088                 . 3 0 0 "1"
    0            5.952 .0514184397163121                 .     24.441 .7503750281802524 1 1 0 "0"
    0            8.194  .093841642228739 .7169811320754716       14.9                 . 2 0 1 "0"
    1           62.644 .3324112494236975 1.071823204419889      256.5 3.127323329496774 1 1 1 "0"
    0           79.096                 .                 .       3042                 . 3 0 0 "1"
    0           29.392 .2024691358024691 .3063427800269906    224.274 2.429788795927894 1 1 1 "0"
    1                . .0152439024390244 3.219239373601789          .                 . . . . "-"
    0           45.743  .106814548361311 3.222222222222222      214.3                 . 3 0 0 "1"
    0           21.134 .0556182639091174 1.226900254309127     2042.3  .588095823139418 1 1 0 "0"
    0           34.423 .0247637666992506 2.612295265873906      285.1 3.557659303548627 1 1 0 "0"
    0            40.79 .0368758144564283  2.48515111695138      403.1 4.249036944285656 1 1 0 "0"
    0                0 .0440145102781137                 .    108.651                 . 2 0 1 "0"
    0                0 .0013664596273292 .6419354838709678     37.255                 . 2 0 1 "0"
    0            8.834 .0867309117865085 .5601990049751243    173.544                 . 1 1 0 "0"
    0           66.718 .0094997632949345 3.629784272790536      128.6                 . 2 0 1 "0"
    0           68.903 .1248020444507048 .7044996815451087    19402.1                 . 3 0 0 "1"
    0           95.006 .2260363344374184 .6130942091616249     8148.8 .8699042754127753 1 1 0 "0"
    0           87.973  .060019989836817 .1124452872922715    82790.8 2.226253703884783 1 1 0 "0"
    0           67.905  .232517143916987 .1728676467549215    12841.7                 . 3 0 0 "1"
    0           44.783 .1860874669797476 .6804938643378755     1512.5 14.10461482229283 1 1 0 "0"
    0           69.324 .5230805030105005 .2705874550247881    29799.2                 . 3 0 0 "1"
    1           41.828 .0597014925373134 .6012188659247484    297.642 .6785149534556049 1 1 1 "0"
    0           68.845 .1095741373950886  .441350033394022    10098.6                 . 2 0 1 "0"
    0           68.845 .1095741373950886  .441350033394022    10098.6                 . 2 0 1 "0"
    0           26.855 .1448329276388582 .3002737226277373      655.8                 . 3 0 0 "1"
    0             20.5 .1035192628173708 .1438763376932223      231.7                 . 3 0 0 "1"
    0           52.866 .2072953736654804 .8261700095510983      107.7                 . 3 0 0 "1"
    1           13.403                 .                 .      48.33                 . 3 0 0 "1"
    0           19.729 .2009174311926605 .3144904458598726    178.128 4.147320131704318 1 1 0 "0"
    0 23.0116719056974                 .                 .          .                 . 3 0 0 "1"
    0           38.784                 0 1.085717417516168    920.176                 . 2 0 1 "0"
    0           39.118                 0 1.085717417516168   1038.865                 . 1 1 0 "0"
    0           41.171 .0359380151665018 1.422266800401204      109.7 .6992244689118378 1 1 0 "0"
    0           48.294 .1278648974668275 1.674418604651163       61.7 2.720838889348038 1 1 0 "0"
    0           37.129 .1150519031141869 .7642209398186315      247.9 .2998574883483222 1 1 0 "0"
    0           36.391 .0507734259996622 1.202969183474545     2587.7 .6502849628183587 1 1 0 "0"
    0           31.303 .1168752827627809 1.492274906766116      148.5                 . 3 0 0 "1"
    0            5.204 .1106965174129353 .6045252368980855      444.2 .0692827892774334 1 1 1 "0"
    1           45.851 .0445802770986145                 .          .                 . 1 1 0 "0"
    1                0 .0976344565945101                 .      201.6 .7319772745511944 1 1 0 "0"
    0         10.18356   .04029147021003 .2969108561341571      523.7 1.202381062543942 1 1 0 "0"
    1           40.379 .3802521008403362 .9064558629776021     92.867 .7550892648356413 1 1 1 "0"
    0           69.624 .0728427780809104 1.056734395227106      924.9                 . 1 1 0 "0"
    0            2.964 .3423645320197044 .7423728813559322       73.7                 . 2 0 1 "0"
    0             9999 .1831255992329818 3.540785498489426     21.226                 . 1 1 1 "0"
    0                0                 .                 .     21.226                 . 2 0 1 "0"
    0           10.577 .3336805555555555 .1022880215343203     22.831 4.058997638740419 1 1 1 "0"
    0                .                 .                 .          .                 . 2 0 1 "0"
    0           21.992 .1635391550476989 .3785159389231181      440.1                 . 2 0 1 "0"
    0          61.1473 .0967635246869832 .9299178347027549      974.4                 . 3 0 0 "1"
    0           24.942  .035538752362949 .7458957887223412    225.658 .8127654596751958 1 1 0 "0"
    0           35.173                 0 .7144808743169399     96.005 .0737848187033645 1 1 1 "0"
    0           36.552 .0498480243161094 .6601941747572815     86.162                 . 1 1 1 "0"
    0            19.12 .0991293061489373 .0043478260869565      675.7  .249880900443325 1 1 0 "0"
    0            1.549                 .                 .      8.723                 . 1 1 0 "0"
    0                0 .0326775956284153 1.258620689655172      9.374                 . 1 1 0 "0"
    0            7.762 .0022068965517241 1.508370044052863    120.371 .8946922146765259 1 1 0 "0"
    1           23.386 .0161375661375661  1.55106237148732      150.2 .4747472931552176 1 1 1 "0"
    0            23.38 .0545017365749399 1.424183006535948      160.6                 . 3 0 0 "1"
    0            23.38 .0545017365749399 1.424183006535948      160.6                 . 3 0 0 "1"
    0           27.022 .0424512718863561 2.766417290108063      129.2                 . 3 0 0 "1"
    0                .                 .                 . 11.3520848 .7623271401584351 1 1 0 "0"
    1           28.079 .4462809917355373 .0864768683274021    473.482 1.392802381560671 1 1 1 "0"
    0           28.079 .2630225080385852  .007704851202609    473.482 1.392802381560671 1 1 1 "0"
    0           23.644 .0256858291106063 22.61261261261261        5.5                 . 1 1 0 "0"
    0            63.25 .1796075717886621 1.161612193588938      908.3 1.065752068822186 1 1 0 "0"
    0           73.261  .068745881836152 .9229349112426035       2172                 . 2 0 1 "0"
    0            5.048 .1004589495155533 2.369718309859155     45.189                 . 2 0 1 "0"
    0           64.998 .0352708580466588  1.00266267265768       1752 .1321348407234089 1 1 0 "0"
    0           15.737 .1237373737373737 1.516290726817043     58.355                 . 1 1 0 "0"
    0           19.337 .1305732484076433 .6873469387755102      150.5                 . 3 0 0 "1"
    0           35.182 .0965179774484079 .3229856197215247      393.9 .3140012929901084 1 1 0 "0"
    0           39.337 .1689599352488871 .2343055308554153      903.6  .447171241137113 1 1 0 "0"
    0             .488 .0015584415584416 .8992805755395683     14.693 1.781198542138533 1 1 1 "0"
    0           31.175                 0               1.5     15.267 .6758726997028535 1 1 0 "0"
    0           10.027 .1956043956043956 .3468271334792122       92.2                 . 1 1 1 "0"
    0           24.246  .109219805782225 4.155308298562819      371.5                 . 3 0 0 "1"
    0           13.701 .0699752804715725 1.114161220043573      278.5                 . 2 0 1 "0"
    0           39.484 .0803921568627451 .2750670241286863    562.238 .2104353143492563 1 1 0 "0"
    0           74.236 .0999101995886562  .795702292945746     1768.5 .0754080558220773 1 1 1 "0"
    1            14.49                 0                 .     78.647 .7198542086098052 1 1 1 "0"
    0           94.634 .1063809703605815 .1628363228699552        205                 . 1 1 0 "0"
    0           34.217 .1525821596244131 1.184100418410042      167.6                 . 1 1 0 "0"
    0           80.799  .103003640776699 .4192400970088925       1362                 . 1 1 0 "0"
    0           44.428 .2061713233036537 .2586857097007141     1193.7                 . 3 0 0 "1"
    0           33.239                 .                 .      348.2                 . 3 0 0 "1"
    0           51.249                 .                 .     1074.1                 . 1 1 0 "0"
    1            25.32 .1021897810218978 1.166666666666667     45.834                 . 3 0 0 "1"
    0           60.206 .0878280934525526 .8912639405204462      258.9                 . 3 0 0 "1"
    1           56.641   .12025685931115 .4002262443438914        224        .652193805 1 1 0 "0"
    0                .                 .                 .          .                 . . . . "-"
    end


  • #2
    As before, Stata needs all the variables in the regression to be numeric. Your variable neither is a string. You will need to destring it as in the previous post if it was being used in the regression. However, if you were using the variable campaignoutcome_num, that’s numeric, so you’re ok. What was the exact command you typed? It could be that you are using an if condition that excludes every observation, e.g. mlogit campaignoutcome_num … if abnormalreturnslongterm>15. speaking of that variable, it has a lot of missing values (coded as . for numeric), and regressions will exclude observations with any variable missing.
    Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

    When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

    Comment


    • #3
      Hi Weiwen,

      Thanks again for answering, I really appreciate it. I pasted below the exact command I entered most recently:

      mlogit campaignoutcome_num marketcapquarterbeforeannouc_num tobinsq_num institutionalownership_num highactivistownership roa_num abno
      > rmalreturnsshortterm_num abnormalreturnslongterm_num, baseoutcome(3)

      too few categories
      r(148);

      (note: highactivistownership is numeric, although it doesn't end in _num)

      I am not using any "if" commands that I know of. The abnormal returns unfortunately do have a lot of missing values, but there is nothing I can do about that. Maybe I can run two regresssions: one including the returns, and one not including them. I am not sure what kind of difference (if any) this would make.

      I am quite confused at this point.



      Comment


      • #4
        Deleted, accidental Double post
        Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

        When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

        Comment


        • #5
          Originally posted by Annie MacKinnon View Post
          I pasted below the exact command I entered most recently:

          mlogit campaignoutcome_num marketcapquarterbeforeannouc_num tobinsq_num institutionalownership_num highactivistownership roa_num abno
          > rmalreturnsshortterm_num abnormalreturnslongterm_num, baseoutcome(3)

          too few categories
          r(148);

          . . . I am quite confused at this point.
          I cannot tell for sure, but if your snippet of a data listing is any indication, you don't have complete data for all of these variables for any observations that are not 1 in the outcome variable. That's what's giving rise to your error message. See below (begin at the "Begin here" comment).

          You can probe further to see whether one or only a few predictors are responsible for most of the case attrition and perhaps omit them from the model if that's defensible from a research objective standpoint.

          In the future, consider attaching your dataset in lieu of -dataex-; it would have pinned this down for sure, and you wouldn't have accidentally omitted one of the variables in your regression command.

          .ÿ
          .ÿversionÿ17.0

          .ÿ
          .ÿclearÿ*

          .ÿ
          .ÿquietlyÿinputÿbyteÿhighactivistownershipÿ///
          >ÿÿÿÿÿÿÿÿÿdouble(institutionalownership_numÿroa_numÿtobinsq_numÿmarketcapquarterbeforeannouc_numÿabnormalreturnslongterm_num)ÿ///
          >ÿÿÿÿÿÿÿÿÿbyte(campaignoutcome_numÿsettlement_numÿproxyvote_num)ÿstr1ÿneither

          .ÿ
          .ÿdestringÿneither,ÿreplaceÿignore(-)
          neither:ÿcharacterÿ-ÿremoved;ÿreplacedÿasÿbyte
          (2ÿmissingÿvaluesÿgenerated)

          .ÿ
          .ÿ/*ÿ"IÿpastedÿbelowÿtheÿexactÿcommandÿIÿenteredÿmostÿrecently:ÿ*/
          .ÿcaptureÿnoisilyÿmlogitÿcampaignoutcome_numÿmarketcapquarterbeforeannouc_numÿtobinsq_numÿ///
          >ÿÿÿÿÿÿÿÿÿinstitutionalownership_numÿhighactivistownershipÿroa_numÿ///
          >ÿÿÿÿÿÿÿÿÿabnormalreturnsshortterm_numÿabnormalreturnslongterm_num,ÿbaseoutcome(3)
          variableÿabnormalreturnsshortterm_numÿnotÿfound

          .ÿ
          .ÿ*
          .ÿ*ÿBeginÿhere
          .ÿ*
          .ÿgenerateÿbyteÿall_nonmissingÿ=ÿ1

          .ÿforeachÿvarÿofÿvarlistÿcampaignoutcome_numÿmarketcapquarterbeforeannouc_numÿ///
          >ÿÿÿÿÿÿÿÿÿtobinsq_numÿinstitutionalownership_numÿhighactivistownershipÿroa_numÿ///
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿabnormalreturnslongterm_numÿ{
          ÿÿ2.ÿÿÿÿÿÿÿÿÿquietlyÿreplaceÿall_nonmissingÿ=ÿ0ÿifÿmi(`var')
          ÿÿ3.ÿ}

          .ÿtabulateÿcampaignoutcome_numÿall_nonmissing,ÿmissing

          campaignouÿ|ÿÿÿÿall_nonmissing
          ÿtcome_numÿ|ÿÿÿÿÿÿÿÿÿ0ÿÿÿÿÿÿÿÿÿÿ1ÿ|ÿÿÿÿÿTotal
          -----------+----------------------+----------
          ÿÿÿÿÿÿÿÿÿ1ÿ|ÿÿÿÿÿÿÿÿ21ÿÿÿÿÿÿÿÿÿ39ÿ|ÿÿÿÿÿÿÿÿ60ÿ
          ÿÿÿÿÿÿÿÿÿ2ÿ|ÿÿÿÿÿÿÿÿ16ÿÿÿÿÿÿÿÿÿÿ0ÿ|ÿÿÿÿÿÿÿÿ16ÿ
          ÿÿÿÿÿÿÿÿÿ3ÿ|ÿÿÿÿÿÿÿÿ22ÿÿÿÿÿÿÿÿÿÿ0ÿ|ÿÿÿÿÿÿÿÿ22ÿ
          ÿÿÿÿÿÿÿÿÿ.ÿ|ÿÿÿÿÿÿÿÿÿ2ÿÿÿÿÿÿÿÿÿÿ0ÿ|ÿÿÿÿÿÿÿÿÿ2ÿ
          -----------+----------------------+----------
          ÿÿÿÿÿTotalÿ|ÿÿÿÿÿÿÿÿ61ÿÿÿÿÿÿÿÿÿ39ÿ|ÿÿÿÿÿÿÿ100ÿ

          .ÿ
          .ÿexit

          endÿofÿdo-file


          .

          Comment


          • #6
            Annie:
            there's a collinearity issue caused by your code that makes -mlogit- stop and throw the error message you reported.
            Start from scratch adding one predictor at a time and see when the issue creeps up.
            Last edited by Carlo Lazzaro; 22 Aug 2022, 10:45.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              You are all very kind - I will use your feedback to try to fix the issue. Thank you so much!

              Comment


              • #8
                One tip is this command:

                Code:
                misstable summarize ampaignoutcome_num marketcapquarterbeforeannouc_num tobinsq_num institutionalownership_num highactivistownership roa_num abnormalreturnsshortterm_num abnormalreturnslongterm_num
                That will show you how much missingness you have in the variables. Again, when you run a regression, Stata (and all other software) will exclude observations with any of the variables missing. The optimal way to deal with this is ... to arrange the data collection process to minimize missing responses in the first place. Which is really not easy and which may not be in your control.

                You could think about how abnormal returns are calculated. The predecessor variables may have a lot of missing values also. The variable may not be critical to your analysis, and if it's important you should decide if you can do without it, e.g. you can release a study with a bunch of caveats. This advice may sound vague, but it's probably much better to consult in person with a topical expert.
                Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

                When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

                Comment

                Working...
                X