Announcement

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

  • Questions concerning AMEs (average marginal effects) in ordinal (multilevel) regression

    Dear colleagues,

    I want to calculate and plot the AMEs of a continuous variable (contVar: Mean=0;SD=1) after I estimated an ordinal model. My plan is to calculate AMEs for different values in the range from -2SD to +2SD with the margins command and plot this AMEs with marginsplot (or if you have better solutions, let me know).

    My questions:

    1.What is the difference between the following command set-ups of the margins command:
    Code:
     margins, dydx(contVar) asobserved
    or
    Code:
    margins, at(contVar=-2(.05)+2) asobserved


    2.Since the first code provides me with just one estimate, how do I estimate and store the AMEs of my contVar in the first dydx()-version for the range from -2SD to +2SD and plot it with marginsplot like it is possible for the second code?

    If you need more detail information, just let me know. But if it is clear to you what I am want to do, I would appreciate your advice/help.

    Best,
    Julian


  • #2
    Do I need to provide more information?

    Comment


    • #3
      Unfortunately, I'm not even sure what margins does with oprobit and ologit. Hopefully someone else can weigh in on that. But I do know that the marginal effects of being in each category have signs that can be different than the signs of the coefficients. As a simple example, suppose there are three outcomes, 0, 1, and 2. Suppose xj has a positive coefficient. That means the latent variable, ystar, increases with xj, on average. That means that probability mass shifts from the lower outcomes to the higher outcomes. So increasing xj may lower the probability of seeing a zero (while increasing the probability of seeing a one or two). But without knowing what margins is doing I can't say any more. It might be a weighted average of the marginal effects at the different outcomes. In any case, I'm not sure these partial effects are the most interesting.

      My suggestion would be to (1) report the average partial effect on P(y > j|x), which always has the same sign as the coefficient, or (2) report the APE on the mean response, which also always has the same sign as the beta. I give an example of that in Section 16.3 of my 2010 MIT Press book, "Econometric Analysis of Cross Section and Panel Data." Regrettably, I see the formula did not make it into the book for the mean. I'm attaching slides for that material. You probably have a little programming to do, and then use bootstrapping to obtain proper standard errors. JW
      Attached Files

      Comment


      • #4
        First off, margins are a little tricky with multiple outcome commands like ologit, because you need a separate predict command for each outcome. So here, for example, are how you can get the AMEs for female in an ologit:

        Code:
        webuse nhanes2f, clear
        ologit health i.female i.black weight
        margins r.female, predict(outcome(#1))
        margins r.female, predict(outcome(#2))
        margins r.female, predict(outcome(#3))
        margins r.female, predict(outcome(#4))
        margins r.female, predict(outcome(#5))
        You may find these handouts helpful for understanding margins:

        http://www3.nd.edu/~rwilliam/xsoc73994/Margins01.pdf

        http://www3.nd.edu/~rwilliam/xsoc73994/Margins03.pdf

        Long and Freese have some great new commands for such things in their spost13_ado file. The new book that explains all their commands is forthcoming from Stata Press: http://www.stata-press.com/forthcoming/ For example, once you have installed spost13 (findit spost13_ado) you could get the same results as above via

        Code:
        . mchange female
        
        ologit: Changes in Pr(y) | Number of obs = 10335
        
        Expression: Pr(health), predict(outcome())
        
                     |      poor       fair    average       good  excellent 
        -------------+-------------------------------------------------------
        female       |                                                       
              1 vs 0 |     0.013      0.023      0.015     -0.014     -0.037 
             p-value |     0.000      0.000      0.000      0.000      0.000 
        
        Average predictions
        
                     |      poor       fair    average       good  excellent 
        -------------+-------------------------------------------------------
          Pr(y|base) |     0.070      0.161      0.284      0.251      0.233
        As Jeff notes, if being female increases the likelihood of being in one category, it must also decrease your likelihood of being in another. In this case, women are more likely to report their helath is poor, fair, or average, and less likely to say their health is good or excellent (compared to men, of course).
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        Stata Version: 17.0 MP (2 processor)

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

        Comment


        • #5
          Thanks Jeff,
          thanks, Richard

          I will look into the recommended slides/papers and if I have further questions I might come back to you. The marginscontplot command seems to be just what I need. Also the spost13_ado file seems promising.


          And I know that the margins command is tricky for ordinal outcomes. So far I wrote a loop to make my code as
          parsimonious as possible.

          To show others what I did so far I will show my code:

          My DV hast four levels (0-3) and the IVs of interest are continuous (contVar) and standardized.

          Code:
          forvalues i=0/3 {
                      margins, at(contVar=(-2(0.25)2)) ///
                      predict(outcome(`i')fixedonly) asobserved
                      marginsplot
                      graph save margins_contVar`i'.gph, replace
          }

          Comment

          Working...
          X