Skip to content

Instantly share code, notes, and snippets.

@04pallav
Created September 13, 2017 22:02
Show Gist options
  • Save 04pallav/eb39736fcf11ce640557731451092278 to your computer and use it in GitHub Desktop.
Save 04pallav/eb39736fcf11ce640557731451092278 to your computer and use it in GitHub Desktop.
Survival Models
https://www.youtube.com/watch?v=Cg0Gl-_6TwM
https://www.analyticsvidhya.com/blog/2014/04/survival-analysis-model-you/
https://www.analyticsvidhya.com/blog/2014/04/solving-survival-model/
https://www.youtube.com/watch?v=17QbQF__9XM
https://rpubs.com/mjeagle/Surv
Survival Models
##########################
They model time to an event. after having heart surgery when is the person dying ? T
We can Linear regrression because
1. The reponse variable T is not normal
2. We have partial information about the features
3. Can model even if we don't have an explantory variable
Properties
1. Individuals do not need to enter the study at same time (STaggered entry)
2. Can drop out
3. individual may be still alive at the end of the event. (censored information)
Functions
Density fn f(t) -- probability of event happening
survival fn S(t) -- P(T>=t) Probability that death happended after time t
Hazard fn -- Instantaneous event rate, the rate of death. Given the patient has survived what is the probability of death at time t (conditional prob)
Kaplan Meier esitmate of survival function
For example, age for marriage, time for the customer to buy his first product after visiting the website for the first time, time to attrition of an employee etc. all can be modeled as survival analysis.
Censored Data
Suppose patients are followed in a study for 20 weeks.
A patient who does not experience the event of interest for the duration of the study is said to be right
censored. Censoring that is random and non informative is usually required in order to avoid bias in
a survival analysis
There are three main types of censoring: right, left, and interval. Censoring could occur, for example, when
administering a survey to mothers every other month asking if they are still breast feeding. Right censoring
occurs when mothers are still breast feeding after the last survey, since we do not know exactly how long they
will continue. Left censoring occurs when mothers enter the study after they have stopped breast feeding. We
do not know exactly when they stopped breast feeding, although we know that it happened before their entry to
the study. Interval censoring occurs if the breast feeding ended between two successive surveys since one can
only say that breast feeding ended somewhere within the past two months.
Cox Proportional Hazards Models (Cox PH)
#############################################
Assumption : The hazard ratio doesnt vary with time (Imp)
To watch properly
https://www.youtube.com/watch?v=VtRrOEdY47I
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment