Skip to content
Victor Dumeige
← All analytics projects

How Long Employees Stay

A survival analysis of 1,129 employees across retail, banking, IT, manufacturing, and other industries, testing which factors make people leave sooner.

Survival AnalysisCox RegressionRPeople Analytics
View data source →
Diverging bar chart of the thirteen significant effects in the final Cox model, from being recruited by the employer at plus 131 percent down to working in IT at minus 44 percent

Highlights

Method
Survival analysis — Kaplan-Meier and Cox proportional hazards
Year
2024
Sample size
1,129 employees
Data source
Kaggle — Employee Turnover

Turnover costs companies more than people realize. The real question is not how many people left. It's who leaves sooner, and why. That is a question about timing, and timing is what survival analysis is built for.

Most companies answer this with logistic regression instead. Logistic regression can only ask yes or no: did this person leave? That throws away everyone who is still working there, or forces a guess about how to label them. Survival analysis doesn't have that problem. "Still employed" is treated as what it is: time that hasn't run out yet. It also shows when people are most likely to leave, not just whether they will.

The data is a public research dataset. It covers 1,129 employees across retail, banking, IT, manufacturing, and other industries. There are 16 variables and no missing values: how long each person stayed, how they were hired, whether they had a coach, how they were paid, how they commuted, and five personality scores.

Two variables stand out. First, coaching: whether the employee has a coach, and who it is (an external coach, no coach, or their own manager). Second, pay: whether the salary is fully declared, or partly paid off the books in what's called a "grey wage" arrangement. The five personality scores look like they come from the Big Five model.

Before building the model, I grouped two variables that had too many small categories to work with. Industry went from 16 levels down to 5. Profession went from 15 down to 7. Any category with enough people kept its own label. The rest got grouped into "other."

Before building the full model, I checked four things on their own.

Gender: I compared survival curves for men and women. No real difference. The curves overlap the whole time.

Age: each extra year of age added about 2% more risk of leaving. Small, but real.

Personality: none of the five personality scores mattered much on their own. Self-control came closest, but still not significant.

Coaching: this is where the sharpest result in the whole study showed up. Among employees with a fully declared salary, people with no coach left at 2.3 times the rate of people coached by their own manager.

Then I built the full model, using every variable and letting stepwise selection pick what mattered. Thirteen effects came out significant. You can see them in the chart above and the table below.

Recruitment method mattered most. Employees the company found first, through a resume on a job site, left at more than twice the rate of people who applied after seeing an ad. A fully declared salary cut the risk of leaving by 40%. Two personality traits, anxiety and self-control, showed up as small but real protective effects, even though neither mattered on its own. That usually means other variables were hiding their effect.

There's an obvious problem with this sample. Two thirds of the employees worked in HR, and three quarters were women. So I reran the model two more ways.

First, on a subsample capped at 100 HR employees, which brings the mix closer to a normal workforce. Six effects held up, and most got stronger. Second, on HR employees only, to see how much the HR-heavy sample was pulling on the results.

Age and both personality effects dropped out of the balanced model. I'd treat those as the least reliable findings. Recruitment method, banking, and pay arrangement held up in every version.

What can a company actually act on here? Not age, industry, or profession. Those are not levers. Recruitment channel, pay transparency, and who does the coaching are the real levers. The strongest signal: when the line manager acts as coach, fully declared employees stay noticeably longer. If that holds up elsewhere, it's a retention fix that costs nothing to run.

The dataset, at a glance

Employees
1,129
Variables
16
Worked in HR
66.8%
Significant effects
13

Three quarters of the sample were women and two thirds worked in HR, which is why the model gets checked again on a more balanced subsample.

Key findings

VariableEffect on turnover riskNote
Recruited by the employer+131%The largest effect in the model. But it's measured against a reference group of only 33 people who applied after seeing an advert, so the interval is wide: 95% CI +27% to +319%. Employees the company approached through a job site left at roughly 2.3 times that group's rate.
Banking industry+38%The highest-risk industry, and one of the effects that held in every version of the model.
Has an external coach+34%Relative to having the line manager act as coach. Having no coach at all also raised risk, but not significantly (p = 0.16).
Each additional year of age+2%Small per year but compounding, and it disappeared once the sample was rebalanced.
Each point of anxiety-7%Higher anxiety scores were associated with staying longer. Not significant when the personality scores were modeled on their own.
Each point of self-control-6%Same pattern as anxiety: significant here, not significant on its own.
Commutes by car-21%Relative to commuting by bus. The effect roughly doubled in the balanced model.
HR profession-31%The single largest group in the sample, at two thirds of all observations.
Retail industry-32%Significant on the full data, but not once the sample was rebalanced.
Commutes on foot-33%Relative to commuting by bus. Likely a proxy for living close to work.
IT profession-40%Held on the balanced sample too, where the effect grew to -54%.
Fully declared salary-40%Employees whose pay was fully on the books left at a substantially lower rate than those on a partly undeclared "grey wage".
IT industry-44%The lowest turnover risk of any industry on the full data.

Effects for categorical variables are measured against a reference level: all other industries, all other professions, applying directly after seeing advertising, the line manager acting as coach, a partly undeclared "grey" salary, and commuting by bus. Percentages are hazard ratios: the change in the risk of leaving at any given moment, not the change in tenure.

Charts

Grouped bar chart comparing six effects between the full-data model and the profession-balanced model, with every effect larger in the balanced version
The same six effects, estimated on the full data and on a subsample capped at 100 HR employees. All six stayed significant, and each one got stronger. That's the sign they were being diluted, not created, by the HR-heavy sample.
Kaplan-Meier survival curves for men and women, with overlapping confidence bands across the whole study period
Separate survival curves for men and women. The bands overlap almost the whole way through, which is why gender didn't make it into the final model.
Two thirds of the sample worked in HR
66.8%in HR
  • HR66.8%
  • Other14.3%
  • IT6.5%
  • Sales5.9%
  • Etc.3.3%
  • Commercial2.1%
  • Teaching1.1%
Share of employees by profession, after the smallest categories were grouped. This imbalance is what the balanced model corrects for.

Limitations

Applied to your organization

Most companies measure turnover with logistic regression: will this person leave, yes or no. That throws away the most useful part of the question, which is when. Survival analysis keeps the timing. Run it on your own HR data and you get a timeline: the months when people are most likely to quit, and which hiring sources or management setups are tied to those early exits. That timeline is what turns a yearly turnover number into something you can act on before people leave.

View data source →R, survival, survminer, MASS, pec, tidyverse