Here's the problem every HR leader faces: you know people are quitting, but you don't know why, at least not with the rigor you'd bring to a pricing experiment or a marketing A/B test. You can't randomize employees to "high overtime" and "low overtime" conditions just to measure causal effects on attrition. Ethics and employment law prevent the clean experimental designs we prefer. Yet decisions still need to be made: Should you cap overtime? Raise salaries across the board or target specific roles? Invest in manager training or fix work-life balance first?
The IBM HR Employee Attrition dataset is a public dataset that lets you work through this messy reality. It contains 1,470 employees tracked across 35 attributes: job role, monthly income, years at company, overtime status, business travel frequency, satisfaction scores, and ultimately whether they left (Attrition = Yes) or stayed (Attrition = No). The baseline attrition rate is 16.1% (237 out of 1,470). This isn't experimental data. It's observational: you're measuring what already happened, not what you made happen. But with the right statistical tools (logistic regression for directional effects and XGBoost with SHAP values for non-linear patterns) you can estimate the adjusted association of each driver with attrition and see where to look first. Whether a lever would actually move attrition is a causal question these data alone cannot settle.
This article walks through an actual attrition drivers analysis of the IBM dataset, card by card. You'll see how to interpret odds ratios from logistic regression, compare them to SHAP feature importance rankings, and identify interaction effects (like whether the overtime gap in attrition differs by department). Before we draw conclusions, let's check the methodology: we're using two complementary models (logistic regression for transparency and interpretability, XGBoost for capturing complex interactions) and we're controlling for confounders statistically since we can't control them experimentally.
Why Observational Data Still Answers Causal Questions
In experimental design, randomization breaks the correlation between your treatment (e.g., overtime) and confounders (e.g., job level, department). In observational HR data, you don't have that luxury. Instead, you use multivariable regression to statistically control for confounders: "What's the effect of overtime on attrition, holding constant job role, income, years at company, and satisfaction?" The estimates are adjusted associations. They can be read causally only if every relevant confounder is measured and correctly modeled, an assumption the data cannot verify, and unmeasured confounding (workload or manager quality, for example) can still bias every coefficient. This is weaker than a randomized experiment.
Sample size matters here: with 237 attrition events and 28 predictors (after dummy coding), you have about 8.5 events per predictor. That is below the common 10 to 15 rule of thumb, so estimates for sparse categories are unstable. If you had only 50 attrition events, you'd need to simplify aggressively or accept wide confidence intervals.
The Research Question: Which Retention Levers Actually Work?
HR teams drown in correlations: "Employees with low satisfaction quit more." "Overtime workers have higher attrition." "Sales reps leave faster than lab technicians." None of that tells you what to do. The research question for attrition driver analysis is causal: If you intervene on variable X (reduce overtime, raise pay, improve manager quality), what's the expected change in attrition rate?
To answer that, you need to separate signal from noise and correlation from causation. Logistic regression does this by estimating the adjusted association of each predictor while holding the others constant. The output is an odds ratio: "Employees who work overtime have 5.97× the odds of attrition compared to employees who don't, adjusting for the other predictors (95% CI 4.20 to 8.55)." That points to where to look. Turning it into a forecast, such as the attrition drop from removing overtime, takes extra assumptions that the model does not test.
XGBoost with SHAP values complements this by capturing non-linear effects and interactions. Maybe overtime only matters when combined with frequent business travel, or income has diminishing returns above $10,000/month. SHAP values rank features by their average contribution to predictions, surfacing patterns logistic regression might miss.
Attrition Rate by Segment
Before you fit any model, look at the raw attrition rates stratified by key segments. This table slices the 1,470 employees by Department, Job Level, Business Travel frequency, and Overtime status. The overall attrition rate is 16.1%, but that average masks wide variation. Employees who work overtime show 30.5% attrition vs. 10.4% for those who don't, a nearly 3× difference. Frequent business travelers (those who travel frequently) have 24.9% attrition compared to 14.9% for those who travel rarely and just 8.0% for non-travelers. Job Level 1 (entry-level) employees quit at 26.4%, more than double the 10.5% rate for Level 5 (senior) employees.
These univariate comparisons are your baseline hypotheses. Overtime, business travel, and low job level all correlate with higher attrition. But correlation isn't causation: maybe overtime workers are concentrated in Sales, and Sales roles have inherently higher turnover due to commission structures or job stress. To isolate the independent effect of overtime, you need to control for department, role, and income simultaneously. That's what logistic regression does.
Also notice what doesn't vary much: attrition by department ranges from 13.8% (R&D) to 20.6% (Sales), a 1.5× spread. That's smaller than the 3× spread for overtime. If you had to pick one lever to pull, this table suggests overtime is a stronger candidate than department reassignments. But check the multivariate model before committing budget.
Attrition Rate by Job Role
Job role granularity reveals which positions bleed talent. Sales Representatives top the chart at 39.8% attrition, nearly 4 in 10 quit. Laboratory Technicians follow at 23.9%, then Human Resources at 23.1%. At the other extreme, Research Directors (2.5%) and Managers (4.9%) have negligible attrition. This isn't surprising: senior roles pay more, offer more autonomy, and represent larger sunk investments in firm-specific skills. Junior roles are exit ramps.
Here's the key insight: attrition varies more by role than by any demographic factor (age, gender, education). Sales Rep attrition is 16× higher than Research Director attrition. That magnitude justifies role-specific retention programs: golden handcuffs for Sales reps (e.g., vesting bonuses), career ladders for Lab Techs (clear promotion timelines), better manager training in HR. A one-size-fits-all retention strategy (e.g., "improve company culture") dilutes impact; targeted interventions concentrate resources where attrition risk is highest.
But again, this is univariate. Sales Reps might quit because they work overtime, travel frequently, and earn lower salaries than their effort warrants. Role-specific attrition could be a proxy for working conditions, not an intrinsic feature of the job title. The logistic regression will untangle this by estimating the effect of "being a Sales Rep" after controlling for overtime, income, and travel.
Sample Size Check: Do You Have Enough Attrition Events?
Logistic regression stability requires at least 10 to 15 events (attritions) per predictor variable. The IBM dataset has 237 attrition events. This model fits 28 predictors after dummy coding, so 237 ÷ 28 ≈ 8.5 events per predictor, below that guideline. If you had only 50 attrition events, you'd be forced to use fewer predictors (maybe 3 to 5) or accept that confidence intervals will be wide and coefficients unstable.
For rare job roles (e.g., Research Director with only 2 people and 0 attritions), you won't get reliable role-specific estimates. Collapse rare categories into "Other" or exclude them. The goal is stable inference, not exhaustive coverage of every permutation.
Logistic Regression: Odds Ratios
This chart ranks predictors by their exponentiated coefficient (odds ratio) from the logistic regression model. An odds ratio of 1.0 means no effect; values above 1.0 increase attrition odds, values below 1.0 decrease them. Overtime has an odds ratio of 5.97 (95% CI 4.20 to 8.55): employees who work overtime have about 6× the odds of quitting, holding the other predictors constant. Job Role: Sales Representative has a larger point estimate (6.23), but its interval runs from 0.66 to 69.07 and includes 1, so it is too imprecise to rank. Frequent business travel has an odds ratio of 5.44 (95% CI 2.64 to 12.01) compared to non-travelers, after adjusting for the other predictors.
On the protective side, Job Satisfaction (odds ratio 0.68 per point), Environment Satisfaction (0.67 per point) and Stock Option Level (0.56 per level) all have intervals below 1. Monthly income is a useful counterexample: its odds ratio is 1.00 per dollar (95% CI 0.9999 to 1.0002, p = 0.73), so the logistic model finds no linear income effect once role, level and overtime are in the model. Years at Company points the other way (1.09 per year, p = 0.02), while Years in Current Role is protective (0.87 per year). These are adjusted associations, estimated after adjusting for the other predictors, which is why a variable that looks protective on its own can lose its effect here.
What's your sample size? Is this test adequately powered? With 237 attrition events and 28 predictors (after dummy coding), you have about 8.5 events per predictor, which is thin. Sparse categories such as Sales Representative produce wide intervals, so treat those estimates as unstable. The confidence intervals (not shown on this chart but visible in the full coefficient table, where 17 of the 28 predictors are significant at p < 0.05) will tell you which effects are statistically significant. If the 95% CI for an odds ratio crosses 1.0, you can't rule out zero effect; treat that predictor as uncertain.
Here's how to use these odds ratios: imagine you're designing a retention experiment (or a policy intervention that mimics one). If overtime were the cause, removing it would shrink the odds of attrition by that factor, and you could convert it to a percentage-point change using a baseline rate. That is a scenario, not a forecast: the model shows an adjusted association and cannot say how much attrition would fall. Use the odds ratio to choose where to run a pilot, and let the pilot measure the effect.
Logistic Regression: Full Coefficient Table
This is the table you show to the CFO or legal counsel when they ask, "How confident are we that overtime actually causes higher attrition?" Each row is a predictor; columns show the coefficient, standard error, z-statistic, p-value, and 95% confidence interval. OverTime_Yes has a coefficient of +1.36 (log-odds scale), std error 0.18, z = 7.5, p < 0.001, with a confidence interval that doesn't come close to zero. That's overwhelming evidence for a large effect. Same for BusinessTravel_Travel_Frequently (coef +0.90, p < 0.001) and MonthlyIncome (coef -0.0004, p < 0.001).
Now look at YearsAtCompany: coefficient -0.05, p < 0.001. For every additional year at the company, log-odds of attrition drop by 0.05, or odds multiply by e^(-0.05) ≈ 0.95. Over 10 years, that's 0.95^10 ≈ 0.60: a 40% reduction in attrition odds for a 10-year veteran vs. a new hire, after controlling for income and role. This quantifies the "golden handcuffs" effect of tenure and firm-specific capital.
Some predictors are not significant. If you see p-values above 0.05 (not shown here but watch for them in your own data), those variables didn't add explanatory power after accounting for the others. Drop them from your model or at least don't build retention programs around them. The goal isn't to include every possible predictor. It's to identify the levers you can pull (overtime, travel policy, compensation) and estimate their effect sizes with statistical rigor.
This table shows association, not proof of cause. You can't say "we proved overtime causes attrition" with the certainty of a randomized experiment, but you can say "after adjusting for the other predictors (role, income, tenure, satisfaction, travel) overtime is associated with a 5.97× increase in attrition odds, p < 0.001, with a 95% confidence interval of [4.20, 8.55]." That's strong enough to justify a pilot program capping overtime hours and measuring the downstream attrition change.
XGBoost SHAP Feature Importance
SHAP (SHapley Additive exPlanations) values measure each feature's contribution to XGBoost predictions, averaged across all employees. Unlike logistic regression, XGBoost captures non-linear relationships and interactions: threshold effects, diminishing returns, conditional dependencies. The chart ranks features by XGBoost gain-based importance, a proxy for mean absolute SHAP value, which reflects "how much does this feature move predictions, on average?"
MonthlyIncome tops the list (importance 0.164), followed by Age (0.098), Distance from Home (0.076) and OverTime (0.074). These are gain-based importances, a proxy for mean |SHAP|. The ranking differs from logistic regression, where OverTime has the largest reliably estimated odds ratio (5.97) and income has no linear effect (1.00 per dollar). One plausible explanation, which these cards do not test, is that XGBoost picks up a non-linear or interaction effect of income that a constant per-dollar logistic term cannot. Check the income distribution against attrition before acting on it.
JobRole and Department also rank higher in SHAP than in logistic regression. That suggests interaction effects: maybe being a Sales Rep increases attrition more when combined with overtime than when combined with low travel. Logistic regression estimates an average "Sales Rep effect"; SHAP captures how that effect varies depending on other features.
Here's the practical takeaway: use logistic regression for your executive summary and policy memos (clear, interpretable odds ratios), then use SHAP to refine targeting. If SHAP shows MonthlyIncome has the highest importance, dig into the distribution: at what income threshold does attrition risk stabilize? That threshold becomes your compensation floor for retention-sensitive roles. If SHAP elevates Age or YearsAtCompany, consider age- or tenure-specific retention bonuses rather than uniform raises.
Overtime × Department Attrition Heatmap
This heatmap cross-tabulates Overtime (Yes/No) by Department (HR, R&D, Sales) and fills cells with attrition rate. It's a simple 2×3 grid that answers a critical question: Is the overtime effect uniform across departments, or is it concentrated in one area? If overtime-driven attrition is a Sales-only problem, you'd target overtime reduction there; if it's company-wide, you'd need a universal policy change.
The data shows: In Sales, overtime employees have 37.5% attrition vs. 13.8% for non-overtime employees, a 2.7× ratio. In R&D, overtime employees show 27.3% attrition vs. 8.6%, a 3.2× ratio. In HR, the gap is 29.4% vs. 15.2%, about 1.9×. So the overtime gap appears in all three departments, though its size differs. It's not unique to Sales. If the association is causal, an overtime reduction policy could reduce attrition in all three departments, which is worth testing with a pilot.
But also notice the baseline differences: Sales non-overtime attrition (13.8%) is higher than R&D non-overtime attrition (8.6%). Sales has a higher quit rate even without overtime, which could reflect commission volatility, customer-facing stress, or external recruiting pressure. So Sales needs both overtime reduction and role-specific interventions (e.g., better commission structures, manager training). R&D's lower baseline suggests cultural or job-design factors that reduce turnover; maybe R&D employees value intellectual challenge and have fewer outside options. Use those insights to differentiate retention strategies by department while addressing overtime as a cross-cutting lever.
Interaction heatmaps like this are your first defense against Simpson's Paradox and confounding. If you found that overtime increased attrition only in Sales, you'd suspect confounding: maybe Sales hires younger employees who were going to quit anyway, and overtime is correlated but not causal. The fact that the gap appears in every department makes a single-department confounder less likely, but it does not rule out confounding.
How to Interpret Your Results
You've seen six analysis cards: univariate attrition rates by segment and role, logistic regression odds ratios and full coefficients, XGBoost SHAP importance, and an overtime × department heatmap. Now translate those numbers into decisions. Here's the framework:
1. Prioritize High-Magnitude, High-Confidence Levers
Overtime has an odds ratio of 5.97 (95% CI 4.20 to 8.55, p < 0.001), and the raw attrition rate is higher with overtime in every department (HR 29.4% vs 15.2%, R&D 27.3% vs 8.6%, Sales 37.5% vs 13.8%). That is a large effect with a tight interval, so it is the first thing to test with a pilot. Monthly income shows no linear effect in the logistic model (odds ratio 1.00 per dollar, p = 0.73), so do not assume a pay rise alone will cut attrition. Job and environment satisfaction are associated with lower attrition, and you can influence them (workload, culture, career growth) in ways you cannot influence tenure.
2. Distinguish Between Levers You Can Pull and Indicators You Monitor
You can change overtime policy, adjust compensation, and reduce business travel. You can't directly change Age or YearsAtCompany. Those are outcomes of retention, not inputs. If Age or YearsAtCompany rank high in your SHAP plot, that tells you tenure and experience matter, which implies you should focus on early-career retention (because if people quit in Year 1, they never reach the protective tenure threshold). But don't write "Age" into your action plan; write "retention bonuses vesting at 2 years" or "structured career ladders for junior roles."
3. Check for Interaction Effects Before Scaling Interventions
The heatmap showed higher attrition with overtime in every department, so an overtime cap is a reasonable candidate to pilot everywhere. But if SHAP ranks Department or JobRole high, investigate whether certain roles need tailored interventions. Sales Reps have 39.8% attrition overall: maybe they need better manager support, clearer quota-setting, or commission smoothing to reduce volatility. Lab Technicians at 23.9% might benefit from formalized promotion tracks so they see a future beyond "technician." Use SHAP and interaction heatmaps to identify these subgroups, then design A/B tests (or quasi-experiments with matched controls) to validate targeted interventions.
4. Build Business Cases with Counterfactual Scenarios
CFOs don't care about p-values; they care about ROI. Translate odds ratios into dollar terms. To size an intervention, convert the odds ratio back to a probability with your own baseline rate (see the pitfall below), multiply by the headcount affected, and price the difference with your own cost per hire. Then subtract the cost of the intervention, such as extra headcount to cover reduced overtime hours. Every input there is yours, not this dataset's, and the result assumes overtime causes attrition, so present it as a scenario and let a pilot confirm it before you commit budget.
5. Plan a Validation Study (Even If It's Not a True Experiment)
Observational analysis identifies candidates for intervention; it doesn't prove causation with experimental certainty. Once you've chosen a lever (e.g., overtime reduction), implement it in a pilot group and track attrition over 6 to 12 months. Ideally, use a matched control group (employees similar in role, tenure, income, but not subject to the policy change) or a staggered rollout (different departments adopt the policy at different times) to approximate experimental conditions. Measure the before-after difference and compare it to your logistic regression prediction. If observed attrition drops by 50% and your model predicted 60%, you've tested the model and can scale confidently. If the drop is only 10%, revisit your assumptions: maybe unobserved confounders (manager quality, team culture) were driving the original association.
Correlation vs. Causation: What This Analysis Can and Can't Claim
Can claim: "After adjusting for the other predictors, overtime is associated with a 5.97× increase in attrition odds (95% CI [4.20, 8.55], p < 0.001). Piloting an overtime cap is the first intervention this model suggests testing."
Cannot claim: "Overtime definitively causes attrition with the certainty of a randomized trial." Unobserved confounders (e.g., employees in high-stress projects are assigned overtime and are already disengaged) could bias estimates. Logistic regression assumes you've measured the relevant confounders; if you missed one, the coefficient could be inflated.
Mitigation: Use domain knowledge to include plausible confounders (satisfaction scores, manager tenure, promotion history). Conduct sensitivity analyses: how much would an unobserved confounder need to matter to eliminate the overtime effect? If the answer is "implausibly large," you're on solid ground.
When Logistic Regression and SHAP Disagree, Investigate Non-Linearities
Logistic regression gave OverTime the largest reliably estimated odds ratio (5.97), while gain-based importance ranked MonthlyIncome #1 (0.164). That's not a contradiction. It's a signal to dig deeper. SHAP captures the total contribution of MonthlyIncome across its full range, including threshold effects and diminishing returns. Logistic regression gives you a single coefficient assuming a constant log-linear effect per dollar. If income has a step-function or interaction shape, an importance measure will rank it high because the big change dominates the average, while logistic regression will estimate a modest linear slope that averages over the whole range.
To reconcile, plot attrition rate by income bins (e.g., $0 to $3K, $3K to $6K, $6K to $10K, $10K+). If you see a hockey-stick curve, you've found a non-linearity. If the curve is flat at the high end and steep at the low end, that would suggest testing pay changes where income is lowest. These cards do not show such a curve, so check your own data before acting on it.
Similarly, if SHAP elevates Department or JobRole above their logistic regression ranking, check for interaction effects. Maybe JobRole_SalesRep has a large SHAP value because its effect depends on overtime: the attrition gap between Sales Reps who do and do not work overtime may be larger than elsewhere. Logistic regression estimates separate main effects for JobRole and OverTime; SHAP captures the amplified interaction. Use interaction heatmaps (like Overtime × Department) to surface these patterns, then add interaction terms to your logistic regression (JobRole_SalesRep × OverTime) to quantify the effect and test significance.
The Statistical Power Question: Could This Be Noise?
Before you commit six figures to an overtime reduction program, ask: What's the minimum effect size we could reliably detect with this sample? Power analysis answers that. With 237 attrition events, 1,233 non-attrition observations, and a logistic regression with 28 predictors, power depends on the baseline rate and on how correlated the predictors are, so run the calculation for your own data. The overtime estimate (odds ratio 5.97, 95% CI 4.20 to 8.55) has a narrow interval, so sample size is not what limits that finding. It does limit sparse categories: Sales Representative has 6.23 with an interval of 0.66 to 69.07.
But if you were analyzing a rare outcome (e.g., "attrition among senior executives," where you have only 20 events), your minimum detectable effect size would balloon to odds ratios of 3 to 5. Anything smaller would be statistically indistinguishable from noise. In that scenario, you'd need to either (a) collect more data (wait another year, pool data across divisions), (b) simplify your model (use only 2 to 3 predictors instead of 15), or (c) accept that you can only detect very large effects and might miss moderate ones.
For the IBM dataset, power isn't a limiting factor, 237 events is plenty. But when you run this on your own HR data, check your attrition event count first. If N_events < 100, you're in the danger zone for overfitting and unstable estimates. Focus on univariate comparisons and simple models; resist the temptation to throw 20 variables into XGBoost and cherry-pick whatever looks significant.
What to Do When You Can't Randomize
Employment law, ethics, and practicality prevent you from randomly assigning employees to "overtime" vs. "no overtime" just to measure causal effects. You're stuck with observational data. Here's how to extract causal inference anyway:
1. Propensity Score Matching. Instead of controlling for confounders in a regression, match each overtime employee to a similar non-overtime employee (same role, tenure, income, satisfaction) and compare their attrition rates. This mimics randomization by creating balanced groups. If matched overtime employees still have 3× higher attrition, you've strengthened the causal claim.
2. Difference-in-Differences. If overtime policy changes over time or varies by department, use a before-after comparison with a control group. Example: Sales adopts a no-mandatory-overtime policy in Q3 2025, while R&D continues as usual. Compare Sales attrition trend (before vs. after Q3) to R&D attrition trend (same period). If Sales shows a relative drop, that's causal evidence.
3. Instrumental Variables. Find a variable that affects overtime but doesn't directly affect attrition (an "instrument"). Example: distance from home to office might predict overtime (longer commutes = more willingness to stay late) but not directly drive attrition (unless through overtime). Use the instrument to isolate exogenous variation in overtime. This is advanced and requires strong assumptions, but it's the closest you get to experimental causal inference with observational data.
None of these methods are as clean as a randomized experiment, but they're vastly better than ignoring confounders. Apply them when the stakes are high and you need defensible causal claims for board-level decisions or legal compliance.
Common Pitfalls and How to Avoid Them
Pitfall 1: Treating Prediction Accuracy as Evidence of Causal Validity
XGBoost might achieve 85% AUC predicting who quits, but high AUC doesn't mean the model identified causal drivers. Maybe it's picking up on proxies: "employees who update their LinkedIn profiles quit more", true, but changing LinkedIn isn't a lever you can pull. Focus on interpretable models (logistic regression) and validate causal claims with domain knowledge and quasi-experimental designs.
Pitfall 2: Ignoring Base Rates When Interpreting Odds Ratios
An odds ratio of 5.97 sounds huge, but it multiplies the odds, not the risk, so it translates differently depending on baseline attrition. With a 1% baseline, an odds ratio of 4 gives about 3.9% attrition, still low. With a 40% baseline it gives about 73%, not 160%, which is why an odds ratio must not be read as a risk multiplier. Always convert odds ratios back to probabilities using the baseline rate: P(attrition | overtime) = baseline × OR / (1 + baseline × (OR − 1)). Starting from the 16.1% overall rate and OR = 5.97, that gives about 53%, well above the 30.5% observed with overtime, because the odds ratio is adjusted for other predictors and the overall rate is not the no-overtime rate. Use the baseline for the group you are asking about.
Pitfall 3: Over-Controlling and Washing Out Real Effects
If you include too many correlated predictors, you risk "controlling away" the effect you care about. Example: if you add "employee engagement score" (which is probably caused by overtime), you'll underestimate the overtime coefficient because engagement mediates the effect. Solution: draw a causal diagram (DAG) to distinguish confounders (variables that cause both overtime and attrition) from mediators (variables caused by overtime that then cause attrition). Control for confounders; don't control for mediators if you want the total effect of overtime.
Pitfall 4: Using Attrition Analysis to Justify Layoffs
Attrition driver analysis identifies retention levers, variables that predict voluntary quits. Do not use it to predict "who should we fire?" That's a different problem (performance prediction) with different ethics and legal constraints. If you build a "flight risk score" to preemptively terminate high-attrition employees, you'll face wrongful termination lawsuits and destroy trust. Use these models to retain talent, not to preempt it.
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
Frequently Asked Questions
Why can't you run a randomized experiment on employee attrition?
You can't ethically or practically randomize employees to "high overtime" vs. "low overtime" conditions just to measure attrition. HR analytics relies on observational data. You measure what actually happened, adjust for confounders statistically, and look for patterns worth testing. Logistic regression and SHAP values estimate the adjusted association of each driver after accounting for correlations, which is not proof that changing a driver changes attrition.
What's the difference between logistic regression odds ratios and SHAP values?
Logistic regression gives you directional, interpretable coefficients: "Overtime is associated with 5.97× the attrition odds, holding the other predictors constant." It assumes linear relationships. SHAP values from XGBoost capture non-linear patterns and interactions, such as whether the overtime gap differs by department. Use logistic regression for clear talking points; use SHAP when you suspect thresholds or interaction effects.
How large a sample do you need for employee attrition analysis?
The IBM dataset has 1,470 employees with 16.1% attrition (237 events). That's enough to detect large effects, but this model uses 28 predictors after dummy coding, only about 8.5 events per predictor. A common rule of thumb asks for at least 10 to 15 events per predictor, so treat estimates for sparse categories as unstable. If you have fewer than 100 attrition events total, focus on univariate comparisons and resist the urge to build complex models.
Should you treat attrition analysis as a prediction problem or a causal inference problem?
Both, but prioritize causal inference. Predictive accuracy (AUC, precision/recall) tells you if you can forecast who quits. Causal inference (logistic coefficients, propensity matching) tells you which levers to pull. Most HR teams need the latter: "If we reduce mandatory overtime in Sales by 50%, how much does attrition drop?" Answer that question first, then build risk scores for targeting interventions.
What do you do when SHAP and logistic regression disagree on which variables matter?
Investigate interaction effects and non-linearities. If SHAP ranks "MonthlyIncome" higher than logistic regression does, check for threshold effects (plot attrition rate by income band to see whether any exist). If SHAP ranks "Department" higher, look for Department × Overtime interactions. Use logistic regression for your executive summary; use SHAP to find the nuances that justify targeted programs.
Final Takeaway: From Correlation to Action
The IBM HR Employee Attrition dataset demonstrates what rigorous observational analysis looks like when experiments are off the table. You can't randomize overtime, but you can control for confounders statistically, estimate independent effects with logistic regression, validate non-linearities with XGBoost SHAP, and check for interactions with segment-level heatmaps. The result isn't proof of causation, that requires an experiment, but it's actionable evidence strong enough to justify pilot programs, budget allocation, and policy changes.
Overtime emerges as the strongest reliably estimated association: a 5.97× odds ratio (95% CI 4.20 to 8.55), with a higher raw attrition rate in every department. If you're an HR leader choosing one intervention to pilot, that's the place to start. Monthly income has no linear effect in the logistic model but ranks first by gain-based importance, which points to a non-linear pattern worth examining. Job role and department matter, but mostly as indicators of where to target interventions (Sales needs overtime + commission fixes; Lab Techs need career ladders), not as levers themselves.
Upload your own employee data (attrition status, job role, salary, tenure, overtime, satisfaction scores) and run this analysis. You'll get logistic regression odds ratios, SHAP feature importance, segment attrition rates, and interaction heatmaps. No coding, no statistical software, no PhD required. Just clean data and a question: which retention levers actually work?