I’m planning on making a few tools to calculate biological age at home using simple tests, but I’ve started with a complicated one, the PhenoAge clock, because I’m going to mention that in an upcoming video and I thought it would be nice if people could work out their own values. If you just want to try it out, head to andrewsteele.co.uk/biological-age, or see an example with some values close to mine when I tried this (please note I’ve added noise to the test results to reduce the chances of my medical records being identified from them).
This repo will contain the basic HTML, JavaScript and CSS behind the calculators. If you find a problem, please report it as an issue, or I’d welcome pull requests building on this. Apologies in advance for my janky scientist-JavaScript—pull requests which make the code more beautiful are also welcome!
This code is free to use as you like but a link to andrewsteele.co.uk/biological-age would be very welcome, firstly to acknowledge the source, and secondly because I’m planning to build that page into a resource with more information about biological age calculations.
For privacy reasons, these calculators will never store your data. You can only access previous results by bookmarking the URL provided, and the results are stored in the URL anchor (the bit after the #
symbol) which is never transmitted to the server—all the calculations are done locally in your web browser.
bioage.css
is a generic CSS file with a few small tweaks to visual appearance that will be used for all the calculators.phenoage.html
andphenoage.js
are the files used to calculate and display PhenoAge estimates from blood tests. Other measures of biological age will get their own HTML and JS files for tidyness.
- There are a couple of
TODO
s in the JavaScript that would be nice to fix. - Improve code commenting
- Convert the test unit conversions into a CSV for ease of adding new ones, and to allow a column containing the source to be included.
- In particular, check the conversion for CRP (see this issue).
- Add more units for the various tests.
- I should have coded the tests, results, units, etc as objects rather than arrays, to make keeping track of what’s going on easier.
- Add default values for people of a specific age, perhaps with a checkbox or other input so you can fill in if you’re missing a couple of tests. (Which I was when I did this!) Get these from the median values for each age of each test from the NHANES data this clock was trained on, make a CSV, allow the JavaScript to read that in.
- Add more methods of converting stuff to biological age, like time standing on one leg etc.
- It would be nice to include uncertainty ranges.
- Time spent standing on one leg
- Heart rate variability (Fitbit data)
- An amazing array of potential biomarkers are listed on the Geriatric Examination Tool Kit.
For more detailed analysis of biomarkers using Python, try Biolearn!