Skip to content

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

Notifications You must be signed in to change notification settings

zuzannna/can-you-survive-this

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

50 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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.

About

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πŸŒˆπŸ‘©πŸΎβ€πŸ’»

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published