ds@mcpanalytics.aiEmail your data and your question and get an answer about your own data, with the method shown.Email your data and question. Get an answer.

Compensation Equity Analysis

By MCP Analytics Team | Published , updated

Most HR teams compare average salaries by gender in a spreadsheet and call it an audit. This analysis does what a proper audit requires: compare compensation across groups while controlling for legitimate pay factors, test whether the remaining gaps are statistically significant, and document the method so it can be reviewed.

Worked Example (Made-Up Data): Raw Gap Versus Same-Level Gap

Question: How does mean pay (average pay) by gender change when we compare all staff with staff at the same job level?

Inputs: Made-up data, seed 17. Each row is one person, with a group, a job level, and a pay amount. The script builds in the same base pay for both groups at each level: $50,000 at the lower level and $80,000 at the higher level. A random amount (normal, standard deviation $4,000) is added to each pay. Men are 10 at the lower level and 30 at the higher level. Women are 30 at the lower level and 10 at the higher level. No pay gap within a level is built in.

Method: Find the mean for each group. Then find the mean within each job level. The gap is women's mean minus men's mean. This sums up the sample. It does not test if the gap could be due to chance.

import numpy as np

# Simulated data, seed 17. Each row is one employee.
rng = np.random.default_rng(17)
rows = []
for group, counts in [('men', {'lower': 10, 'higher': 30}),
                      ('women', {'lower': 30, 'higher': 10})]:
    for level, count in counts.items():
        base = 50000 if level == 'lower' else 80000
        salaries = base + rng.normal(0, 4000, count)
        rows.extend((group, level, float(salary)) for salary in salaries)

array = np.array(rows, dtype=object)
groups = array[:, 0]
levels = array[:, 1]
salaries = array[:, 2].astype(float)
men_mean = salaries[groups == 'men'].mean()
women_mean = salaries[groups == 'women'].mean()
raw_diff = women_mean - men_mean
raw_pct = 100 * raw_diff / men_mean
n_men = (groups == 'men').sum()
n_women = (groups == 'women').sum()
print(f"Employees: {len(rows)} (men: {n_men}, women: {n_women})")
print(f"Mean pay, men: ${men_mean:,.2f}")
print(f"Mean pay, women: ${women_mean:,.2f}")
print(f"Raw difference (women minus men): ${raw_diff:,.2f} "
      f"({raw_pct:.2f}% of men's mean)")
for level in ('lower', 'higher'):
    mask = levels == level
    male_avg = salaries[mask & (groups == 'men')].mean()
    female_avg = salaries[mask & (groups == 'women')].mean()
    print(f"{level.title()} level means: men ${male_avg:,.2f}; "
          f"women ${female_avg:,.2f}; "
          f"difference ${female_avg - male_avg:,.2f}")

Printed output:

Employees: 80 (men: 40, women: 40)
Mean pay, men: $71,747.07
Mean pay, women: $56,574.46
Raw difference (women minus men): $-15,172.61 (-21.15% of men's mean)
Lower level means: men $48,322.78; women $48,787.95; difference $465.16
Higher level means: men $79,555.17; women $79,934.01; difference $378.84

Result: Across all 80 staff, women's mean pay is $15,172.61 lower, which is 21.15% of the men's mean. Within each job level the group means are close: women are $465.16 above men at the lower level and $378.84 above at the higher level. Because equal pay at each level is built in, there is no within-level gap for the script to find. Those two small differences are chance. With a $4,000 spread and groups of 10 and 30, the standard error of each difference is about $1,460, so a difference of a few hundred dollars is well within noise. The whole raw gap comes from the mix of job levels: 30 of the 40 men are at the higher level and 30 of the 40 women are at the lower level.

Limit: The data are made up and have only two job levels. This demo does not test if the gap could be due to chance, include other parts of pay, or show if a real firm pays fairly. Real data can differ in every one of these ways.

Sources

Simpson described the reversal of a group gap once the groups are split in 1951. This paper is cited for who and when. No number on this page comes from it.

Why a Spreadsheet Average Is Not a Pay Equity Audit

The raw pay gap is the simple difference in average pay between two groups. It can be misleading for your organization's internal audit, because it doesn't account for legitimate pay factors.

A proper compensation equity analysis asks a more specific question: after controlling for job role, experience, education, performance, and location, do statistically significant pay gaps remain? The gap can grow or shrink after adjustment, depending on how the groups differ in the pay factors used in the check. The adjusted gap is the one that speaks to whether the company is paying differently for the same work.

You upload a CSV from your HRIS, specify the compensation column and the grouping variables, and get a statistical comparison. A spreadsheet of averages does not show how a gap was tested. A statistical analysis with a documented method, significance testing, and effect sizes can be reviewed.

How a Proper Pay Equity Analysis Works

A sound audit has two layers:

Layer 1: Unadjusted group comparison: compare mean and median compensation between groups (male vs. female, or across ethnic groups) without any controls. This is the "headline number", the same kind of figure as a publicly reported pay gap. You produce it with a t-test (two groups) or ANOVA (three or more groups). Even though it doesn't control for pay factors, this number matters: it is the figure people will compare their own experience against.

Layer 2: Controlled comparison: the same analysis, but run within comparable groups. Instead of comparing all men to all women, compare men and women within the same job level, department, and experience band. If you have enough granularity in your data, this approach controls for legitimate pay factors without requiring multivariate regression. Within each group, a remaining gap is not explained by the factors you stratified on, but it may still reflect factors you did not include.

The first layer tells you what the gap looks like. The second layer tells you how much of it remains within comparable groups. Neither one on its own decides whether pay is fair: when several factors matter at once, use a regression that adjusts for them together, and have legal or compensation specialists review any unexplained gap before drawing conclusions.

What Data Do You Need?

A CSV export from your HRIS combining compensation and demographic data. Some companies need to merge payroll data with demographics from a separate HRIS export.

Required columns

Columns for a controlled analysis

Sample size guidance

How to Read the Report

Group means and medians: the raw numbers. Mean salary for men, mean salary for women, and the difference in both absolute dollars and percentage terms. The median is often more informative than the mean for compensation data, because a few highly paid executives can pull the mean up without reflecting the typical employee's experience.

Box plots: visual comparison of the salary distributions by group. Overlapping boxes suggest similar compensation; clearly separated boxes suggest a gap worth testing. The plot shows the shape of the gap, but significance comes from the statistical test, not from how the boxes look. Look for outliers (the dots beyond the whiskers): a few extremely high or low salaries can distort the means.

ANOVA F-test (for 3+ groups), if you're comparing pay across multiple ethnic groups, departments, or job levels, the F-statistic and p-value tell you whether at least one group differs significantly. The p-value is the probability of seeing differences at least this large if there were no real pay difference between the groups. A p-value below 0.05 is statistically significant evidence against "no difference", not proof that a gap is real or what caused it; a p-value above 0.05 is not proof of equal pay either. Significance alone isn't enough: look at the effect size (eta-squared), and read it apart from the p-value.

Tukey HSD post-hoc comparisons: after ANOVA finds a significant overall difference, Tukey identifies which specific pairs differ. This is critical for pay equity: "Compensation differs significantly across ethnic groups" is a finding. A pair-by-pair result that names which two groups differ, by how many dollars, and with what interval, is an actionable finding.

Confidence intervals: for each comparison, the report shows the estimated size of the gap with upper and lower bounds. A confidence interval that excludes zero goes with a significant result. The width tells you about precision: a narrow interval gives you a specific remediation target, and a wide interval means you need more data or tighter comparable groups.

Effect size (Cohen's d): measures practical significance, separate from statistical significance. In compensation analysis, even a small effect size can translate to meaningful dollar amounts when multiplied across the workforce.

What to Do With the Results

Immediate

Strategic

When to Use Something Else

Your turn

Bring your own data and the question you actually need answered.

MCP AnalyticsData science by email Send us your data and your question, and we will reply. ds@mcpanalytics.ai