Pay-Equity Audit in Python: Raw Gap, Regression and a Remediation Budget
<p>An anonymous post says women at Sahyadri Systems, a Pune IT services company, are paid less for the same work, and its biggest client now wants evidence of equal pay. Nandini Rao, Head of Total Rewards, has to answer the CHRO before the April increment cycle: is there a gap, how much of it is about the job, and what would fixing it cost?</p><p>Across five lessons you build that audit in Python on your own copy of the HRMS exports. You build the population first: permanent, active employees only, gender typed five different ways, salaries taken from an effective-dated history (with promotions keyed in before they start) and written as rupee text. Then the raw gap by mean and median, on base pay at full time, and split by level to see how much comes from women being concentrated in lower-paid levels. Then the adjusted gap: a log-pay regression in statsmodels with level, department, location and rating as categories, read as a percentage with its p-value and confidence interval. Finally fair pay, the model's pay for each woman's profile as a man, and an upper-bound budget for raising every woman below it, set against the smaller cost of closing the adjusted gap itself.</p><p>In every lesson you build it yourself first, then give the same job to your AI (ChatGPT, Claude, Copilot or Gemini) and learn exactly where it goes wrong: errors="coerce" dropping salaries, NR ratings silently removed from the model, a coefficient reported without 1 - exp(), fair pay that bakes the gap in. In the capstone your AI writes the whole audit from one brief, and you sign it off.</p><p>Bartman runs your script on its own servers against your data and checks the files it writes, so every check is about your real output, not a screenshot.</p>
Tools: Python, pandas, statsmodels, Linear Regression, Pay Equity Analysis, People Analytics, matplotlib, AI Assistants for Python