📋 KEY INSIGHTS
- People analytics (HR analytics, workforce analytics) applies data science to human resources decisions: predicting which employees are at risk of leaving (attrition prediction), optimising compensation structures (pay equity analysis, market benchmarking), forecasting workforce demand (headcount planning), identifying high-potential employees, and improving recruiting pipeline efficiency. The field has grown rapidly as HR data infrastructure has matured — HR Information Systems (HRIS), applicant tracking systems (ATS), performance management platforms, and engagement survey tools generate rich longitudinal employee data.
- Employee attrition prediction is the most widely deployed HR analytics model: given historical HR data for employees who stayed or left, train a classifier to score current employees by their probability of leaving within a specified horizon (typically 90 days to 12 months). Feature families: tenure and career progression (time in role, number of promotions, time since last promotion), compensation (salary relative to market median, compa-ratio, time since last raise), engagement (survey scores, 360 feedback ratings, performance ratings), workload proxies (after-hours email, vacation days taken, meeting load from calendar data), team and manager features (manager tenure, team attrition rate, span of control), and job characteristics (role criticality, remote/hybrid status, travel requirements).
- Pay equity analysis uses regression to decompose compensation into explained (job-related) and unexplained (potentially discriminatory) components: fit a linear regression of compensation on legitimate compensable factors (job level, function, location, experience, performance rating), then examine residuals stratified by protected characteristics (gender, race/ethnicity). Statistically significant negative residuals for a protected group indicate a potential pay gap after controlling for legitimate factors. The standard methodology follows the Biddle & Associates framework and is used by HR analytics teams for annual pay equity audits required by law in many jurisdictions.
- Survival analysis is the statistically correct framework for attrition modelling: employees enter the study at hire date and exit at termination date (the event) or at the analysis date (censored, still employed). Cox proportional hazards regression models the hazard rate h(t|x) = h_0(t)exp(β’x) — the instantaneous probability of leaving at time t given covariates x — without specifying the baseline hazard shape. This properly handles censoring (we observe that an employee has not yet left, which is informative), unlike logistic regression that ignores tenure structure. The connection to our survival analysis guide is direct: employee attrition is the canonical survival analysis application in business data science.
- Fairness-aware ML is essential in HR analytics because models that inform hiring, promotion, and compensation decisions are legally regulated (EEOC in the US, GDPR Article 22 in Europe). Disparate impact analysis (four-fifths rule) checks whether a model’s selection rate for a protected group is at least 80% of the selection rate for the highest-scoring group. Counterfactual fairness requires that the model’s prediction does not change when protected attributes are counterfactually changed, while holding all other factors fixed. The connection to our data science ethics guide is direct: HR models are the highest-stakes fairness domain because errors can directly harm individuals through discriminatory hiring, firing, or compensation outcomes.
- Workforce planning and headcount forecasting combine external labour market data with internal demand signals to forecast hiring needs by function, level, and geography 12-24 months ahead. The modelling approach integrates: internal attrition predictions (from the survival model), internal mobility flows (promotion/transfer probabilities estimated from historical movement matrices), business growth drivers (revenue forecast per HC, headcount per product line), and external hiring difficulty signals (LinkedIn data, offer acceptance rates, time-to-fill by role). This connects to our time series analysis guide and probabilistic forecasting guide: headcount forecasts are time series with hierarchical structure (by function, level, location) that benefit from probabilistic intervals to plan for hiring contingencies.
People analytics has evolved from descriptive HR reporting (headcount, turnover rates, time-to-hire) to predictive modelling (attrition risk, promotion readiness, pay equity gaps) and prescriptive analytics (personalised retention interventions, optimal job posting strategies, structured hiring scorecards). The business case is compelling: replacing an employee typically costs 50-200% of their annual salary in recruiting, onboarding, and lost productivity costs, so a model that reduces voluntary attrition by even 5-10% generates significant returns. This guide covers the full people analytics toolkit: attrition prediction and survival analysis, pay equity regression, workforce planning and headcount forecasting, recruiting funnel analytics, engagement driver analysis, and the fairness and legal constraints that govern HR models.
Attrition Modelling — Survival Analysis and Feature Engineering
Employee attrition is a natural survival analysis problem: each employee has a hire date (the study entry), potentially a termination date (the event), and a tenure distribution that is right-censored for employees who have not yet left. Logistic regression on a “did the employee leave in the next 12 months?” binary label is the simplest approach but has two flaws: (1) it ignores the information that longer-tenured employees have remained through more “risk periods”, (2) it treats different tenure employees identically even though early-career employees have structurally different attrition hazard rates. Cox proportional hazards regression addresses both flaws: the hazard function h(t|x) = h_0(t)exp(β₁x₁ + β₂x₂ + … + βₚxₚ) models the instantaneous risk of leaving at time t as a function of covariates x, with a baseline hazard h_0(t) that captures the tenure-dependence shared by all employees. The connection to our survival analysis guide is direct: that guide covers Cox regression implementation with lifelines and scikit-survival, Kaplan-Meier curves stratified by employee segment, and time-varying covariates (allowing covariate values like performance ratings and compensation to change over time). Feature engineering for attrition models requires careful handling of time-varying features: compensation should be measured as compa-ratio (salary / market median salary for the role and level) rather than absolute salary; performance ratings should be measured as the trend over recent quarters rather than the latest value alone; engagement survey scores should be aligned to the employee’s survey response date, not the analysis date. The connection to our feature engineering guide is direct: temporal feature engineering (lag features, rolling means, trend indicators) for attrition follows the same patterns as time series feature engineering described there.
| Analysis Type | Method | Output | Key Package | Primary Use Case |
|---|---|---|---|---|
| Attrition risk scoring | Cox PH regression / XGBoost + SHAP | 12-month leave probability per employee | lifelines, scikit-survival | Retention intervention targeting |
| Pay equity audit | OLS regression on compensable factors | Unexplained pay gap by protected group | statsmodels, R lm() | Legal compliance; compensation review |
| Engagement driver analysis | Lasso regression / XGBoost on survey items | Top engagement drivers + feature importance | scikit-learn, SHAP | HR programme prioritisation |
| Headcount forecasting | Bayesian hierarchical time series + attrition model | Probabilistic headcount by org unit | Prophet, Stan, lifelines | Workforce planning; hiring budget |
| Recruiting funnel analysis | Funnel conversion rates + logistic regression | Offer acceptance probability; time-to-fill | pandas, scikit-learn | Recruiting efficiency; sourcing mix |
Pay Equity Analysis and Fairness-Aware HR Models
Pay equity analysis is both a legal compliance requirement and an HR analytics capability. The statistical methodology: collect compensation data (base salary, total cash, total compensation) for all employees; fit an OLS regression model using legitimate compensable factors as predictors — job level/grade, function/organisation, geographic market, years of relevant experience, years at company, performance rating (average of last 2-3 years), and education level where legally permitted; examine the residuals (actual compensation minus model-predicted compensation) stratified by gender, race/ethnicity, age, and other protected classes. A statistically significant mean residual for a protected group (tested with a t-test adjusted for multiple comparisons using Bonferroni or FDR correction) indicates a potential pay gap. The connection to our hypothesis testing guide is direct: pay equity analysis is a multiple regression inference problem where correctly interpreting coefficient confidence intervals and controlling Type I error (false positive pay gap findings) are as important as the regression itself. The connection to our data science ethics guide is direct: pay equity analysis exemplifies the fairness methodology of that guide — specifically the concept of equalised residuals across protected groups after controlling for legitimate covariates, which is equivalent to the individual fairness notion in algorithmic fairness. Beyond pay equity, HR models used for hiring decisions (ATS resume screening, interview score models), promotion recommendations, and performance rating calibration are subject to disparate impact doctrine. SHAP explanations for attrition risk scores are particularly valuable in HR contexts: they allow HR business partners to show employees and managers the specific factors driving a high attrition risk score (low compa-ratio, long time since promotion, low engagement score), making the model’s output actionable and defensible.
Workforce Planning, Recruiting Analytics and Engagement Drivers
Workforce planning integrates attrition forecasts, internal mobility flows, and business demand signals to produce headcount forecasts by function, level, and geography. The modelling architecture: (1) run the attrition survival model to estimate the expected terminations from the current workforce over the planning horizon; (2) model internal mobility as a Markov chain over job levels and functions, using historical transition matrices to estimate the flow of employees between roles; (3) incorporate business growth assumptions (revenue per HC by function, new product team headcount requirements) to derive the external hiring demand; (4) wrap the entire forecast in a probabilistic forecasting framework (quantile forecasts for hiring budget planning). Recruiting funnel analytics measures conversion rates at each stage of the hiring funnel (application → phone screen → technical assessment → panel interview → offer → acceptance), identifies where the funnel is leaking, and predicts offer acceptance probability from candidate and job characteristics using logistic regression. The connection to our A/B testing guide is direct: job posting content experiments (title wording, description length, compensation transparency), recruiter outreach message experiments, and hiring process redesigns are all analysed as controlled experiments where the funnel conversion rate is the primary outcome metric. Engagement survey driver analysis uses regularised regression (Lasso to select the most important survey items) or gradient boosting with SHAP to identify which specific survey items (manager quality, career growth opportunity, team collaboration, work-life balance) are the strongest predictors of overall engagement score and retention, enabling HR to prioritise programme investments with the highest expected return on engagement.
✦ SUMMARIZE THIS ARTICLE WITH AI
Survival analysis (Cox regression, Kaplan-Meier) for attrition modelling is in our Survival Analysis guide. Data science ethics and fairness-aware modelling for HR decisions is in our Data Science Ethics guide. SHAP explanations for HR model transparency are in our Model Interpretability guide. A/B testing for recruiting and HR programme experiments is in our A/B Testing guide. Probabilistic forecasting for headcount planning is in our Probabilistic Forecasting guide. Data science in finance (compensation benchmarking, budget modelling) shares methodology with our Data Science for Finance guide.



