Announcement

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

  • How can I select particular outcome of prediction of margin among whole data?

    Click image for larger version

Name:	캡처 2022-12-20 164725.png
Views:	1
Size:	43.3 KB
ID:	1694206




    Here is a margin table of my data, whose name is 'datatable'.
    I just typed 'margins datatable' simply and got this result. Next I drawed marginsplot, but it was too confusing because all 8 plots were intersecting each other.
    So, I want to remove outcomes of prediction of 3, 4, 5, 6 among those. So far, I found how to hide them from graph, but not removing completely and now thinking removing them prior to make marginsplot.
    What should I do in this situation?

  • #2
    Code:
    sysuse auto, clear
    mlogit rep78 mpg displ
    *INCLUDE ONLY OUTCOMES 1, 3 & 5
    margins, dydx(*) predict(outcome(1)) predict(outcome(3)) predict(outcome(5))
    Res.:

    Code:
    . *INCLUDE ONLY OUTCOMES 1, 3 & 5
    
    .
    . margins, dydx(*) predict(outcome(1)) predict(outcome(3)) predict(outcome(5))
    
    Average marginal effects                        Number of obs     =         69
    Model VCE    : OIM
    
    dy/dx w.r.t. : mpg displacement
    1._predict   : Pr(rep78==1), predict(outcome(1))
    2._predict   : Pr(rep78==3), predict(outcome(3))
    3._predict   : Pr(rep78==5), predict(outcome(5))
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    mpg          |
        _predict |
              1  |  -.0005117   .0056718    -0.09   0.928    -.0116282    .0106049
              2  |   -.004905   .0163699    -0.30   0.764    -.0369894    .0271794
              3  |   .0075342   .0079805     0.94   0.345    -.0081074    .0231758
    -------------+----------------------------------------------------------------
    displacement |
        _predict |
              1  |  -1.28e-06   .0003301    -0.00   0.997    -.0006483    .0006457
              2  |   .0016077   .0009552     1.68   0.092    -.0002645    .0034798
              3  |  -.0019893   .0010984    -1.81   0.070    -.0041421    .0001635
    ------------------------------------------------------------------------------
    
    .

    Comment

    Working...
    X