A friend posted this on Instagram and it got me thinking - is it actually true?

How long do people live?
Predicting the future is a really tricky problem. An individual’s life expectancy depends on their genetics, their exposure to risk factors including commodities and their socioeconomic status, and a fair bit of luck. Prognostication at this level is essentially impossible, unless you happen to be falling out a plane without a parachute or suffering something equally as mechanistically predictable.
But it’s easier to do this on a population basis using national records, and this is exactly what the Office of National Statistics do in the UK by publishing life tables.
Superficially, the above statement is incorrect. Men in the UK live on average 78.8 years, and women 82.8. But it’s not as simple as that.
For each age window, the population of that age have a slightly different life expectancy. The longer you live, the more selection bias creeps in, removing those with tragically short lives and extending the life expectancy of that cohort. Think about this logically - if I live to be 79, does that mean my life expectancy is -0.2 years? Or are my exposures over those 79 years putting me into a different risk bracket to the “average” man?
There’s also two ways this can be estimated. Most commonly is period estimates, i.e. assuming that people experience today’s age-specific mortality rates for the rest of their lives. In reality future mortality may improve, so a cohort estimate is also offered, which builds in projected improvements in life expectancy and hence is usually higher.
When is middle age then?
Let’s define mid-life
This means that if
Mid-life crisis app
The app is here, and code is available on GitHub.
There’s two parts to it. The first is a script that pulls the latest ONS life-tables, and strips out the period life expectancies for use in the Shiny app.
The app then gets
Obviously this remains a population estimate and doesn’t account for any changes in future life-expectancies, or any personal risk factors, so don’t go using this as a guide for any significant life decisions… but it’s quite a fun little problem to code