Announcement

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

  • Is margins the correct approach?

    Hi all,

    A colleague and I are attempting to determine whether an analysis we'd like to accomplish is done so using the margins command. They write:

    "Back in my graduate school days, I *think* I remember running a bunch of equations around women’s and men’s salary gaps, and basically looking at what we would expect a woman to earn if they had men’s slopes (at their own means) and what we’d expect men to earn if they had women’s slopes (at their own means) – OR something like that. The point was to show how much the gap would close if women got the same mileage out of their experiences as men got."

    To me, this sounds close to calculating marginal effects, but I could be wrong here. We are also thrown off by the Stata documentation for margins, which states:

    "after a linear regression fit on males and females, the marginal mean (margin of mean) for males is the predicted mean of the dependent variable, where every observation is treated as if it represents a male; thus those observations that in fact do represent males are included, as well as those observations that represent females. The marginal mean for female would be similarly obtained by treating all observations as if they represented females."

    The documentation seems to indicate that the margins command would not be used in the case my colleague described. As such, I am hoping for more clarity on the math behind the margins command, and insight into whether or not it is the best way to approach our case.

    Thank you!
    Last edited by BI Fahlstrom; 30 Oct 2019, 13:12.

  • #2
    I would first start by looking at Richard Williams "Using Stata’s Margins Command to Estimate and Interpret Marginal Effects" (avail here). He walks through a number of examples (and you can see if any of them give you what you want).

    Comment


    • #3
      If I understand you correctly, how about something like this:

      Code:
      webuse nhanes2f, clear
      reg health i.black i.female age weight if heartatk == 0
      * no heart attack, both coefficients and means
      margins
      * no heart attack coefficients, has had heart attack means
      margins if heartatk == 1, noesample
      Or, instead of margins,

      Code:
      webuse nhanes2f, clear
      reg health i.black i.female age weight if heartatk == 0
      predict xhealth if heartatk == 1
      sum xhealth
      Basically the strategy is compute the coefficients for one group; then use the coefficients for that group with the composition of the other group.

      I'm sure there are other, possibly simpler, ways.
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

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

      Comment


      • #4
        This probably isn't my clearest handout ever, but it tries to explain how to do what I think you want, and why you would want to do it.

        https://www3.nd.edu/~rwilliam/stats2/l44.pdf
        -------------------------------------------
        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