Announcement

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

  • Gender Pay Gap

    I want to calculate the gender pay gap. For this, I use the following command:

    egen median_inc_m = median(inc) if (sex==1)
    egen median_inc_f = median(inc) if (sex==2)
    gen paygap = (median_inc_m - median_inc_f) / median_inc_m * 100

    However, the generated variable paygap has zero observations and therefore no value. Where is my error?

  • #2
    median_income_m contains the medium income for males when the observation is male and missing otherwise. Similarly, medium_income_f contains the medium income for females and missing otherwise. Assuming that there is no observation who is simultaneously male and female, then there is no observation that contains both medians.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment

    Working...
    X