GithubHelp home page GithubHelp logo

zuzannna / can-you-survive-this Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 2.0 4.82 MB

All you need to learn/teach basics of survival analysis. Deck & Python code with simulations, examples and more. Workshop originally delivered at Grace Hopper Celebration #GHC2018๐ŸŒˆ๐Ÿ‘ฉ๐Ÿพโ€๐Ÿ’ป

License: MIT License

Jupyter Notebook 100.00%

can-you-survive-this's Introduction

Can you survive this workshop? Brief introduction to survival analysis.

Co-authored by Marianne Hoogeveen and Zuzanna Klyszejko

All you need to learn/teach basics of survival analysis. Deck & Python code with simulations, examples and more. Workshop originally delivered at Grace Hopper Celebration #GHC2018๐ŸŒˆ๐Ÿ‘ฉ๐Ÿพโ€๐Ÿ’ป

Presentation

The slides for the presentation we gave at GHC'18 can be found in the presentaton folder, under GHC18_survival_workshop.pdf

Handouts

There are 2 handouts that were given out during the workshop; they can be found in the handouts folder:

  1. Breakout_Activity__Censoring.pdf asks the participants to classify several situations as either right censoring, left cenoring, or something else
  2. Breakout_Activity__Blinking_Experiment.pdf asks participants to perform an experiment in which one person tries go go as long as possible without blinking, and the experimenter notes their time in seconds, and whether they have any eyewear (contact lenses or glasses) or not.

Example Notebooks

There are 5 notebooks containing more details on concepts that were touched on during the workshop. You can view them in the browser but we encourage you to download them and play with numbers yourself. Here are some ideas you could start with: change distribution properties, add random (or not so random!) noise or use a completely different dataset. For example, there were many datasets distributed with R package which you could use to play with Cox Proportional Hazards Model or to plot Kaplan-Meier curve.

See Dependencies and requirements section at the end for installation tips.

Survival Analysis Example

The notebook SurvivalAnalysisExample.ipynb introduces several standard computational methods in survival analysis that are used to determine the effect of diverse factors on survival. For example, we used log rank test and Cox Proportional Hazards model on sample data set with the lifelines package in Python.

Survival Function and Hazard Rate

The notebook SurvivalFunctionAndHazardRate.ipynb shows the relationship between several important functions related to probability distributions one encounters for instance in survival analysis: the survival function, the hazard rate, the probability density function, and the cumulative density function.

Censored survival data

The notebook CensoredSurvivalData.ipynb illustrates the effect of having censored data, and why simply removing censored data is not the right thing to do.

Survivorship Bias

The notebook SurvivorshipBias.ipynb illustrates the reverse problem with censored data: when only censored observations are considered using an example of two gamblers with different strategies (high and low risk).

Blinking Experiment Results

The notebook BlinkingExperimentResults.ipynb contains code to help you analyze the time-before-you-blink data collected during the workshop. This data was uploaded in the data folder.

Dependencies and requirements

If you have Anaconda (or Miniconda) installed:

You'll need to install the lifelines package by typing the following comman in your command line (after cloning the repo and cd to the main repo directory):

conda install -c conda-forge lifelines

The notebooks also use software for making visualizations, such as seaborn:

conda install seaborn

Alternatively, you could use pip install to get all the packages once you clone the repo and type:

pip install -r requirements.txt

Finally, if you're new to Jupyter Notebooks, go here to read the docs.

can-you-survive-this's People

Contributors

marianneke avatar zuzannna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

danxiecmu2016

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.