Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: question from statalist


From   "Paley, Irina" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: RE: question from statalist
Date   Thu, 9 Apr 2009 10:05:12 -0400

Maarten,

First of all, thanks so much for your help and for the code you provided!

I use your exact code for mlogit, adapted to my dataset, and when I run margeff I get that it's invalid syntax. What do you mean by leaving out reference category? Here is the code, I know it's a lot of state dummmies but want to include everything so that you may be able to help in terms of your suggestion that I may have left out the reference category:


. xi3: mlogit prod_type female_o ///
> fico ltv dti income loanamount loanterm ///
> ba_new f_min_arm5 t10_min_t1 e.state if prod_type<=3
e.state           _Istate_1-72        (naturally coded; _Istate_1 omitted)

note: _Istate_72 dropped because of collinearity
Iteration 0:   log likelihood = -80777.976
Iteration 1:   log likelihood =  -62434.56
Iteration 2:   log likelihood =  -54653.76
Iteration 3:   log likelihood = -53558.389
Iteration 4:   log likelihood = -53461.761
Iteration 5:   log likelihood = -53459.728
Iteration 6:   log likelihood = -53459.595
Iteration 7:   log likelihood = -53459.547
Iteration 8:   log likelihood =  -53459.53
Iteration 9:   log likelihood = -53459.523
Iteration 10:  log likelihood = -53459.521
Iteration 11:  log likelihood =  -53459.52
Iteration 12:  log likelihood =  -53459.52
Iteration 13:  log likelihood =  -53459.52
Iteration 14:  log likelihood =  -53459.52
Iteration 15:  log likelihood =  -53459.52
Iteration 16:  log likelihood =  -53459.52
Iteration 17:  log likelihood =  -53459.52
Iteration 18:  log likelihood =  -53459.52
Iteration 19:  log likelihood =  -53459.52
Iteration 20:  log likelihood =  -53459.52
Iteration 21:  log likelihood =  -53459.52
Iteration 22:  log likelihood =  -53459.52
Iteration 23:  log likelihood =  -53459.52

Multinomial logistic regression                   Number of obs   =     150920
                                                  LR chi2(120)    =   54636.91
                                                  Prob > chi2     =     0.0000
Log likelihood =  -53459.52                       Pseudo R2       =     0.3382

------------------------------------------------------------------------------
   prod_type |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
p2     |
 female_only |  -.1644218    .028526    -5.76   0.000    -.2203318   -.1085118
        fico |   -.000043    .000244    -0.18   0.860    -.0005213    .0004354
         ltv |   -.012363   .0009911   -12.47   0.000    -.0143055   -.0104204
         dti |   .0012936   .0011557     1.12   0.263    -.0009715    .0035588
      income |   .0001116    .000094     1.19   0.235    -.0000727    .0002958
  loanamount |   .0027795   .0000821    33.84   0.000     .0026186    .0029405
    loanterm |   .3070569   .0056616    54.24   0.000     .2959604    .3181534
      ba_new |   1.331781   .1505607     8.85   0.000     1.036687    1.626874
  f_min_arm5 |   3.556796    .238242    14.93   0.000     3.089851    4.023742
  t10_min_t1 |  -.2732542   .0436088    -6.27   0.000    -.3587258   -.1877826
   _Istate_2 |   1.404028   .8146043     1.72   0.085    -.1925675    3.000623
   _Istate_4 |   1.851683   .0845556    21.90   0.000     1.685957    2.017409
   _Istate_5 |  -.2542361   .2536984    -1.00   0.316    -.7514759    .2430037
   _Istate_6 |   1.988177   .0610167    32.58   0.000     1.868587    2.107768
   _Istate_8 |   1.590537   .1505265    10.57   0.000      1.29551    1.885563
   _Istate_9 |   .3956479    .148358     2.67   0.008     .1048714    .6864243
  _Istate_10 |   1.047124   .3765112     2.78   0.005     .3091759    1.785073
  _Istate_11 |   1.091745    .136762     7.98   0.000     .8236962    1.359793
  _Istate_12 |   .9929799   .0706914    14.05   0.000     .8544273    1.131532
  _Istate_13 |   .8390499   .0797687    10.52   0.000      .682706    .9953937
  _Istate_15 |   .1933299   .3782888     0.51   0.609    -.5481024    .9347623
  _Istate_16 |   1.300786   .2912771     4.47   0.000     .7298937    1.871679
  _Istate_17 |   1.348988   .0800501    16.85   0.000     1.192093    1.505884
  _Istate_18 |   .3205358   .2973393     1.08   0.281    -.2622386    .9033101
  _Istate_19 |   .1994127   .1975181     1.01   0.313    -.1877158    .5865411
  _Istate_20 |   .1753627   .1704026     1.03   0.303    -.1586203    .5093457
  _Istate_21 |   .8648893   .3639088     2.38   0.017     .1516412    1.578137
  _Istate_22 |   1.120478   .3423585     3.27   0.001      .449468    1.791489
  _Istate_23 |  -.4779814   .4965849    -0.96   0.336     -1.45127     .495307
  _Istate_24 |   1.616128   .0769673    21.00   0.000     1.465274    1.766981
  _Istate_25 |   .5176749   .1036091     5.00   0.000     .3146048    .7207449
  _Istate_26 |   .7126129   .2149384     3.32   0.001     .2913414    1.133884
  _Istate_27 |   .9179268   .1901944     4.83   0.000     .5451526    1.290701
  _Istate_28 |   .4442854   .5862039     0.76   0.449    -.7046532    1.593224
  _Istate_29 |   .1558309   .1267915     1.23   0.219     -.092676    .4043377
  _Istate_30 |   1.631823   .7260361     2.25   0.025     .2088187    3.054828
  _Istate_31 |   1.380824   .5177043     2.67   0.008      .366142    2.395506
  _Istate_32 |   1.735698   .1069213    16.23   0.000     1.526136     1.94526
  _Istate_33 |   .4981945   .3056388     1.63   0.103    -.1008465    1.097236
  _Istate_34 |   .2757105   .1151865     2.39   0.017     .0499491    .5014719
  _Istate_35 |   .0638504     .28167     0.23   0.821    -.4882126    .6159134
  _Istate_36 |   .2073928   .0976959     2.12   0.034     .0159124    .3988733
  _Istate_37 |   .5389933   .0870315     6.19   0.000     .3684148    .7095718
  _Istate_38 |   .7423465    .990366     0.75   0.454    -1.198735    2.683428
  _Istate_39 |   .7521487   .2213912     3.40   0.001       .31823    1.186067
  _Istate_40 |  -.1641945   .2052702    -0.80   0.424    -.5665168    .2381277
  _Istate_41 |   1.547014   .1193776    12.96   0.000     1.313038     1.78099
  _Istate_42 |   .4184825   .1408953     2.97   0.003     .1423328    .6946323
  _Istate_44 |   1.055626   .1798321     5.87   0.000     .7031615     1.40809
  _Istate_45 |   .8307923   .0970417     8.56   0.000      .640594    1.020991
  _Istate_46 |   2.295348   1.041904     2.20   0.028     .2532534    4.337442
  _Istate_47 |   .3185616   .1561612     2.04   0.041     .0124913    .6246319
  _Istate_48 |   .0704744   .0805286     0.88   0.381    -.0873588    .2283075
  _Istate_49 |   1.340968    .274445     4.89   0.000     .8030656     1.87887
  _Istate_50 |  -20.92257          .        .       .            .           .
  _Istate_51 |   1.483839   .0790609    18.77   0.000     1.328882    1.638795
  _Istate_53 |   1.650136    .084293    19.58   0.000     1.484925    1.815348
  _Istate_54 |   -20.7129          .        .       .            .           .
  _Istate_55 |    .442238   .2858147     1.55   0.122    -.1179485    1.002425
  _Istate_56 |   1.520046   .7394808     2.06   0.040     .0706898    2.969401
       _cons |   -14.3261   .3101159   -46.20   0.000    -14.93392   -13.71829
-------------+----------------------------------------------------------------
p3     |
 female_only |   .2604863   .0204588    12.73   0.000     .2203879    .3005848
        fico |  -.0053049   .0001614   -32.87   0.000    -.0056212   -.0049885
         ltv |   .1046274   .0013747    76.11   0.000     .1019331    .1073218
         dti |  -.0135648   .0010501   -12.92   0.000    -.0156231   -.0115066
      income |  -.0105184   .0003618   -29.08   0.000    -.0112274   -.0098093
  loanamount |   .0055794   .0001316    42.41   0.000     .0053215    .0058372
    loanterm |  -.3034597   .0029286  -103.62   0.000    -.3091997   -.2977197
      ba_new |   .9560689   .1181522     8.09   0.000     .7244948    1.187643
  f_min_arm5 |   1.470707    .184718     7.96   0.000     1.108666    1.832748
  t10_min_t1 |  -1.629084   .0372435   -43.74   0.000     -1.70208   -1.556088
   _Istate_2 |  -17.84067          .        .       .            .           .
   _Istate_4 |   3.347497   .0661506    50.60   0.000     3.217844     3.47715
   _Istate_5 |  -.0600854   .1694684    -0.35   0.723    -.3922373    .2720666
   _Istate_6 |   3.718972   .0544284    68.33   0.000     3.612294     3.82565
   _Istate_8 |    2.09187   .1502934    13.92   0.000       1.7973     2.38644
   _Istate_9 |   1.187121    .119402     9.94   0.000     .9530976    1.421145
  _Istate_10 |   2.201173   .2871991     7.66   0.000     1.638273    2.764073
  _Istate_11 |   3.180965   .0906589    35.09   0.000     3.003277    3.358653
  _Istate_12 |   2.570462   .0554813    46.33   0.000     2.461721    2.679204
  _Istate_13 |   1.361451   .0635688    21.42   0.000     1.236859    1.486044
  _Istate_15 |    2.35953   .2537935     9.30   0.000     1.862104    2.856957
  _Istate_16 |   1.335838   .2966257     4.50   0.000      .754462    1.917214
  _Istate_17 |   1.403901   .0813102    17.27   0.000     1.244536    1.563266
  _Istate_18 |   .3039104    .219299     1.39   0.166    -.1259078    .7337285
  _Istate_19 |    .065849   .2216248     0.30   0.766    -.3685276    .5002257
  _Istate_20 |  -.7770885   .1890087    -4.11   0.000    -1.147539   -.4066382
  _Istate_21 |  -.5719042   .5138452    -1.11   0.266    -1.579022    .4352138
  _Istate_22 |  -.2488122   .4265315    -0.58   0.560    -1.084798    .5871742
  _Istate_23 |   .5687787   .3337475     1.70   0.088    -.0853544    1.222912
  _Istate_24 |   2.847323    .061477    46.32   0.000      2.72683    2.967815
  _Istate_25 |     1.4701   .0823627    17.85   0.000     1.308672    1.631528
  _Istate_26 |   1.265193   .1399441     9.04   0.000     .9909081    1.539479
  _Istate_27 |    1.95618   .1151893    16.98   0.000     1.730413    2.181947
  _Istate_28 |   .0641282   .4398633     0.15   0.884    -.7979881    .9262444
  _Istate_29 |   .7745147     .08641     8.96   0.000     .6051542    .9438751
  _Istate_30 |  -20.52806          .        .       .            .           .
  _Istate_31 |   .2656588   .7094426     0.37   0.708    -1.124823    1.656141
  _Istate_32 |   3.387917   .0779911    43.44   0.000     3.235057    3.540776
  _Istate_33 |   .5705496   .3490233     1.63   0.102    -.1135235    1.254623
  _Istate_34 |   1.474503   .0813253    18.13   0.000     1.315109    1.633898
  _Istate_35 |   1.806132   .1022284    17.67   0.000     1.605768    2.006496
  _Istate_36 |   1.337217   .0791314    16.90   0.000     1.182122    1.492311
  _Istate_37 |   .7828433   .0693641    11.29   0.000     .6468922    .9187944
  _Istate_38 |  -.2571256   1.035192    -0.25   0.804    -2.286065    1.771814
  _Istate_39 |  -.1111388   .2140775    -0.52   0.604     -.530723    .3084454
  _Istate_40 |  -1.716052   .2565891    -6.69   0.000    -2.218957   -1.213146
  _Istate_41 |   2.825521    .089155    31.69   0.000     2.650781    3.000262
  _Istate_42 |    .268916   .1239261     2.17   0.030     .0260254    .5118066
  _Istate_44 |    3.00538   .0913932    32.88   0.000     2.826253    3.184507
  _Istate_45 |   .7360729   .0895809     8.22   0.000     .5604976    .9116483
  _Istate_46 |  -17.12545          .        .       .            .           .
  _Istate_47 |   .0364547   .1421689     0.26   0.798    -.2421912    .3151006
  _Istate_48 |  -.7433416   .0793908    -9.36   0.000    -.8989448   -.5877385
  _Istate_49 |   1.808562   .3023695     5.98   0.000     1.215928    2.401195
  _Istate_50 |  -.3550958   1.028818    -0.35   0.730    -2.371542     1.66135
  _Istate_51 |   2.756216    .062717    43.95   0.000     2.633293    2.879139
  _Istate_53 |   2.660653   .0708606    37.55   0.000     2.521768    2.799537
  _Istate_54 |   .3778534   .4032841     0.94   0.349    -.4125689    1.168276
  _Istate_55 |   1.075562   .1817899     5.92   0.000       .71926    1.431863
  _Istate_56 |   1.588009   .6064127     2.62   0.009     .3994615    2.776556
       _cons |  -1.921791   .2055431    -9.35   0.000    -2.324648   -1.518934
------------------------------------------------------------------------------
(prod_type==p1 is the base outcome)



. margeff
invalid syntax
r(198);



Thanks so much!

Irina





-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Maarten buis
Sent: Thursday, April 09, 2009 4:49 AM
To: stata list
Subject: st: RE: question from statalist


--- On Wed, 8/4/09, Paley, Irina wrote:
> I have two specifications-- with state dummies and without.
> When I include state dummies, stata issues an error after margeff 
> saying:
>
> estimates post: matrix has missing values

Did you leave out the reference category when estimating your model?

> Question number 2 is the following. When I don't include state 
> dummies, stata computes margeff and shows it to be positive, while the 
> coefficient itself is negative (and mfx estimate is negative). What 
> are the conditions under which this can take place? I thought that 
> unlike magnitudes, the direction of the coefficients should stay the 
> same whichever way we estimate the marginal effects...

It is actually possible for the marginal effects in models like -mlogit-, -oprobit-, or -ologit- to have a different sign than the coefficient, but I would not expect -mfx- and -margeff- to produce different signs.

-margeff- shows an extra panel of output for the reference category of the outcome variable in the first panel, so the first panel in -margeff- does not correspond with -mfx- with the -predict(pr eq(#1))- option. As a consequence it is very easy to compare the wrong panels. Maybe that is what is going on here.

-- Maarten

-----------------------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.soziologie.uni-tuebingen.de/Institut/MitarbInst/MBuis.html
-----------------------------------------



      

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index