Coder Social home page Coder Social logo

ajsteele / ageless Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 1.0 66.37 MB

Data, calculations and text relating to my book, Ageless: The new science of getting older without getting old

Home Page: https://andrewsteele.co.uk/ageless/

R 16.76% HTML 83.24%
gbd calculations countries age deaths aging international biology biogerontology aging-biology ageing-biology book author data ageing

ageless's Introduction

Ageless data and calculations

These scripts calculate various statistics used in the book Ageless: The new science of getting older without getting old.

If you’re just here for the answers rather than the code, here they are:

The data and code in this repository are occasionally updated as I perform new calculations, and if I find any mistakes. For completeness, the 1.0 release corresponds to the first publication of the book, in hardback form.

Other references can be found at andrewsteele.co.uk/ageless/references and other data and calculations simple enough not to require scripting are available in this Google Drive folder.

The reason I had to do these calculations is that I couldn’t find estimates for some of the specific numbers in the literature, and I’d like these scripts to help people wanting to talk or write about ageing to have accurate values for things like the percentage of deaths caused by ageing in their country, in a format that makes them as easy to update as possible when new data are released.

If anything is unclear or you spot any errors, please contact me. Feel free to download and modify these scripts for your own purposes, or make pull requests if you’d like to contribute. I’d be keen to tidy this up and make a self-generating ageing data report but haven’t got time right now!

output/

This is the output of the scripts using the data which I used when writing the book. Most people will be interested in the .html files which are the mini-reports generated showing the numbers. There are also .txt files where messages and errors during compiling are dumped.

code/

causes-with-age.R

This looks at how different causes of death vary with age, based on World Health Organization Global Burden of Disease (WHO GBD) data.

deaths-caused-by-ageing.R

This calculates the number of deaths that can be attributed to ageing in different countries and around the world, using WHO GBD data.

le-sex-difference.R

This calculates the difference in lifespan between women and men, in different countries and around the world, based on WHO GBD data.

mortality-with-age.R

This looks at how risk of death varies with age in high-income countries, using data from the Human Mortality Database.

population.R

This calculates the global population based on UN and IHME scenarios under the (rather simplistic!) assumption that we either cure ageing or all death in 2025. This requires some pretty large data files, so it downloads them at runtime, rather than them being included in this repository.

init.R

Initialisation and various convenience functions. Required packages are imported here too.

spin-reports.R

Convenience script to spin all the reports. I used this because I wanted the reports to be code- and message-free so they'd be easier to read. If you prefer a standard spin which shows its working, feel free not to use this.

stattoplot.R

Styling and convenience functions for plotting, inspired by bbplot.

data/

who-gbd/

These data are from the World Health Organization Global Burden of Disease. Some files are from the preexisting Data Resources, while others were compiled using the GBD Results Tool. The actual data used are provided here for convenience under a Creative Commons Attribution-NonCommercial 4.0 International License.

It also contains three files with the suffix -selected.csv that are used, unsurprisingly, to select various categories, causes of death and impairments for convenience.

mortality.org/

This folder is mostly empty as per the Human Mortality Database User Agreement which requests that copies of data downloaded are not passed to other users.

It is used in mortality-with-age.R via the read_life_table_hmd() and read_population_hmd() convenience functions in init.R which expect this folder to be populated. You will need to download the ‘Period data’, ‘Population estimates (January 1)’ and ‘Life Tables - Both Sexes’, and then move the Population and bltper_1x1 folders into this folder for the script to work.

codelist.csv translates between the HMD-specific country codes and the ISO equivalents (eg GBR_NP instead of GBR for the UK), and may need updating if more countries are added and you wish to include them.

un/

UN data is used for GDP per capita in deaths-caused-by-ageing.R. The actual data used are reproduced here with attribution to the UNdata service under its terms and conditions of use.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.