People Analytics
Lesson opener
In one line: People analytics improves hiring, performance, and retention with metrics — under ethical and legal guardrails.
Why it matters: Attrition and bad hires are expensive; biased models create legal and trust risk. Good people analytics is careful by design.
Before this lesson: Descriptive analytics; Predictive analytics for modelling habits (features, not protected classes).
Goal
Use data to improve hiring, performance, retention, and organizational design—ethically and legally.
Key questions
- Who performs best and why (role, tenure, training)?
- Who is likely to leave (attrition risk)?
- Do hiring screens predict performance?
- Are promotions and pay equitable across groups?
Metrics
| Metric | Definition |
|---|---|
| Headcount | Active employees |
| Attrition rate | Exits / Avg headcount (period) |
| Time to hire | Days from req open to accept |
| Performance rating | Normalized score (watch bias) |
| Engagement score | Survey index |
Predicting attrition
Features: tenure, department, salary vs market, manager turnover, engagement.
Ethics: Avoid protected attributes as model inputs; audit for disparate impact; human review for decisions.
Hiring analytics
- Structured interviews — consistent rubric beats unstructured "gut"
- Validation — correlate assessment scores with on-job performance 6–12 months later
Simpson's paradox in HR
A policy can look good overall but harm a subgroup—always segment results.
Sample
import pandas as pd
hr = pd.read_csv("data/hr.csv")
attrition_by_dept = hr.groupby("department")["left_company"].mean()
print(attrition_by_dept.sort_values(ascending=False))Teacher walkthrough: attrition by department → intervention
All figures illustrative.
Step 1 — Define attrition. Exits / average headcount in the period; state whether resignations only or all exits.
Step 2 — Segment. hr.csv groupby department (and tenure band if available).
Step 3 — Hypotheses, not blame. High attrition in Support + new managers → investigate workload and manager span — not "fire low performers" from a single rate.
Step 4 — Ethics gate. No protected attributes in scoring; human review before any adverse action; prefer non-punitive interventions (career pathing, load balance).
Step 5 — Prescribe. One retention action for the hottest department; one hiring-process check (structured interview rubric).
Failure example: model used protected proxies
Symptom: Attrition model "worked" but flagged a demographic group disproportionately via zip and school proxies.
Diagnosis: Features correlated with protected classes; no disparate-impact review.
Correction: Drop proxy-heavy features; audit outcomes by group; require HR + legal review; use for support outreach, not auto-termination.
Validation: Documented feature list, audit table, and human-in-the-loop policy before any pilot.
Guided practice
Company average attrition 12%; Dept A 11%, Dept B 18%. Overall looks "fine." What paradox risk do you check?
Complete solution: Simpson's paradox / subgroup masking — overall green while B burns. Always segment; also check tenure mix (many new hires can distort rates).
Independent practice
Acceptance criteria:
- Attrition (or leave rate) by at least one dimension from sample or workplace data.
- Two ethical guardrails written as operating rules.
- One non-punitive retention intervention tied to a finding.
- Statement of what the analysis must not be used for.
Common mistakes
- Ranking people for exit without human review.
- Ignoring Simpson's paradox (overall vs subgroup).
- Using engagement scores as sole truth without response bias note.
- Treating correlation (tenure vs leave) as proven cause.
Practice
Do this now (click): Open Exercise 6 — HR attrition →
Checklist
- [ ] I computed attrition rate by one dimension
- [ ] I listed two ethical guardrails for people models
- [ ] I suggested one non-punitive retention intervention
- [ ] Acceptance criteria above are met