85
Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine, Ljubljana, Slovenia Ljubljana, August 2011 Stare (SLO) Introduction to EHA 1 / 46

Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Embed Size (px)

Citation preview

Page 1: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Introduction to Event History/Survival Analysis

Janez Stare

Faculty of Medicine, Ljubljana, Slovenia

Ljubljana, August 2011

Stare (SLO) Introduction to EHA 1 / 46

Page 2: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Literature

1 Janet M. Box-Steffensmeier, Bradford S. Jones. Event HistoryModeling. [A Guide for Social Scientists]. Cambridge UniversityPress 2004.

2 Hans-Peter Blossfeld, Götz Rohwer. Techniques of Event HistoryAnalysis. Lawrence Erlbaum Associates, London 2002.

3 Hans-Peter Blossfeld, Katrin Golsch, Götz Rohwer. Event HistoryAnalysis with Stata. Lawrence Erlbaum Associates, London 2007.

4 David Collett. Modelling Survival Data in Medical Research.Chapman& Hall, London 2003.

5 David W. Hosmer, Stanley Lemeshow. Applied Survival Analysis;Regression Modeling of Time to Event Data. John Wiley & Sons,New York 1999. Analysis. Draft, 2008.

Stare (SLO) Introduction to EHA 2 / 46

Page 3: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Characterization of processes we are interested in

Coleman (1981):

1 there is a collection of units, each moving among a finite numberof states;

2 changes (events) may occur at any point in time;3 there are factors, possibly time-dependent, influencing the events.

We should add

1 effects of covariates may change in time;2 measurements are often (almost always) censored.

Stare (SLO) Introduction to EHA 3 / 46

Page 4: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Examples

Source: Blossfeld, Golsch, Rohwer (2007)

medical studies duration of life after diagnosis;labour market studies workers move between unemployment and

employment, full-time and part-time jobs, or amongvarious kind of jobs;

demographic studies durations of marriages or consensual unions;studies of organizational ecology durations of existence of firms,

unions, organizations;

Stare (SLO) Introduction to EHA 4 / 46

Page 5: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Other names for Event History/Survival Analysis are

Failure Time Data AnalysisReliability Analysis

Stare (SLO) Introduction to EHA 5 / 46

Page 6: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

When would one use the methods of EHA?

When the outcome of interest is time to some event.

This answer is rather obvious, but why do we need special methods?

Stare (SLO) Introduction to EHA 6 / 46

Page 7: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

When would one use the methods of EHA?

When the outcome of interest is time to some event.

This answer is rather obvious, but why do we need special methods?

Stare (SLO) Introduction to EHA 6 / 46

Page 8: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

When would one use the methods of EHA?

When the outcome of interest is time to some event.

This answer is rather obvious, but why do we need special methods?

Stare (SLO) Introduction to EHA 6 / 46

Page 9: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

A typical situation

1990 1995 1997 2000

Stare (SLO) Introduction to EHA 7 / 46

Page 10: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

A typical situation

1990 1995 1997 2000

t=0 3 5 t=10

Stare (SLO) Introduction to EHA 7 / 46

Page 11: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

A typical situation

1990 1995 1997 2000

t=0 3 5 t=10

S(3)=6/10

Stare (SLO) Introduction to EHA 7 / 46

Page 12: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

A typical situation

1990 1995 1997 2000

t=0 3 5 t=10

S(3)=6/10 S(5)=4/6

Stare (SLO) Introduction to EHA 7 / 46

Page 13: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The need for special methods comes from censoring. There may bedifferent reasons for censored data:

lost to follow upevent of a different type (like death for other reasons)end of study (most common)

Stare (SLO) Introduction to EHA 8 / 46

Page 14: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

With censored data we can’t even calculate a simple arithmetic mean(in the usual way) or draw a histogram.

So, the situation seems pretty much hopeless.

Luckily, it is not, although it took some time to come up with methodsthat deliver want we want.

What do we want?

Stare (SLO) Introduction to EHA 9 / 46

Page 15: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

With censored data we can’t even calculate a simple arithmetic mean(in the usual way) or draw a histogram.

So, the situation seems pretty much hopeless.

Luckily, it is not, although it took some time to come up with methodsthat deliver want we want.

What do we want?

Stare (SLO) Introduction to EHA 9 / 46

Page 16: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

With censored data we can’t even calculate a simple arithmetic mean(in the usual way) or draw a histogram.

So, the situation seems pretty much hopeless.

Luckily, it is not, although it took some time to come up with methodsthat deliver want we want.

What do we want?

Stare (SLO) Introduction to EHA 9 / 46

Page 17: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

With censored data we can’t even calculate a simple arithmetic mean(in the usual way) or draw a histogram.

So, the situation seems pretty much hopeless.

Luckily, it is not, although it took some time to come up with methodsthat deliver want we want.

What do we want?

Stare (SLO) Introduction to EHA 9 / 46

Page 18: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The Goals of EHA

1 Estimation of the distribution (survival) function.2 Comparison of distribution (survival) functions.3 Finding association between the outcome (survival time) and

prognostic variables.

Stare (SLO) Introduction to EHA 10 / 46

Page 19: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The Goals of EHA

1 Estimation of the distribution (survival) function.

2 Comparison of distribution (survival) functions.3 Finding association between the outcome (survival time) and

prognostic variables.

Stare (SLO) Introduction to EHA 10 / 46

Page 20: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The Goals of EHA

1 Estimation of the distribution (survival) function.2 Comparison of distribution (survival) functions.

3 Finding association between the outcome (survival time) andprognostic variables.

Stare (SLO) Introduction to EHA 10 / 46

Page 21: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The Goals of EHA

1 Estimation of the distribution (survival) function.2 Comparison of distribution (survival) functions.3 Finding association between the outcome (survival time) and

prognostic variables.

Stare (SLO) Introduction to EHA 10 / 46

Page 22: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Survival function

Formally:

If T is a continuous non-negative random variable with density f (t),then its survival function is

S(t) = P(T > t) = 1− F (t) =

∫ ∞t

f (x)dx ,

It means:

The value of the survival function at any given time t is the proportionof people still not experiencing the event (e.g. still alive, stillworking) at that time.

Stare (SLO) Introduction to EHA 11 / 46

Page 23: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Survival function

Formally:

If T is a continuous non-negative random variable with density f (t),then its survival function is

S(t) = P(T > t) = 1− F (t) =

∫ ∞t

f (x)dx ,

It means:

The value of the survival function at any given time t is the proportionof people still not experiencing the event (e.g. still alive, stillworking) at that time.

Stare (SLO) Introduction to EHA 11 / 46

Page 24: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Estimating the survival function

HHHHH

HHHH

���������

F (Failure)

S (Survival)

π

1− π

Stare (SLO) Introduction to EHA 12 / 46

Page 25: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Estimating the survival function

@@@@@

�����

�����

HHHHH

�����

HHHHH

E+

E-

0.4

0.6

F

S

S

F

0.015

0.985

0.005

0.995

0.006

Probability

0.003

Stare (SLO) Introduction to EHA 13 / 46

Page 26: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Estimating the survival function

More formally, we are using the formula for the probability of a productof events.

If A and B are two events, then the probability of the product AB is

P(AB) = P(A)P(B|A)

where P(B|A) is the conditional probability of B given A.

Stare (SLO) Introduction to EHA 14 / 46

Page 27: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Estimating the survival function

More formally, we are using the formula for the probability of a productof events.

If A and B are two events, then the probability of the product AB is

P(AB) = P(A)P(B|A)

where P(B|A) is the conditional probability of B given A.

Stare (SLO) Introduction to EHA 14 / 46

Page 28: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Estimating the survival function

HHHHH

HHHHHH

HHHHHHH

������

������

���

���

1 2 3

S

S

F

S

F

F

1− π1

1− π2

1− π3

π1

π2

π3

Stare (SLO) Introduction to EHA 15 / 46

Page 29: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Estimating the survival function

HHHHH

HHHHHH

HHHHHHH

������

������

���

���

1 2 3

S

S

F

S

F

F

S

F

F

0.7

0.8

0.9

0.3

0.2

0.1

Stare (SLO) Introduction to EHA 15 / 46

Page 30: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Estimating the survival function

HHHHH

HHHHHH

HHHHHHH

������

������

���

���

1 2 3

S

S

F

S

F (P = 0,7× 0,2)

F0.7

0.8

0.9

0.3

0.2

0.1

Stare (SLO) Introduction to EHA 15 / 46

Page 31: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Estimating the survival function

HHHHH

HHHHHH

HHHHHHH

������

������

���

���

1 2 3

S

S

F

S

F (P = 0,7× 0,2)

F (P = 0,7× 0,8× 0,1)0.7

0.8

0.9

0.3

0.2

0.1

Stare (SLO) Introduction to EHA 15 / 46

Page 32: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Estimating the survival function

HHHHH

HHHHHH

HHHHHHH

������

������

���

���

1 2 3

S

S

F

S (P = 0,7× 0,8× 0,9)

F (P = 0,7× 0,2)

F (P = 0,7× 0,8× 0,1)0.7

0.8

0.9

0.3

0.2

0.1

Stare (SLO) Introduction to EHA 15 / 46

Page 33: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Estimating the survival function

We can use this principle in calculating survival even with censoreddata.

We first divide the time scale into intervals in such a way that events orcensorings occur on the boarders of the intervals.

Then we calculate (conditional) probabilities of surviving each intervaland obtain probability of surviving any time by simply multiplying theprobabilities of survival up to the given point in time.

The method is named after Kaplan and Meier.

Stare (SLO) Introduction to EHA 16 / 46

Page 34: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Estimating the survival function

We can use this principle in calculating survival even with censoreddata.

We first divide the time scale into intervals in such a way that events orcensorings occur on the boarders of the intervals.

Then we calculate (conditional) probabilities of surviving each intervaland obtain probability of surviving any time by simply multiplying theprobabilities of survival up to the given point in time.

The method is named after Kaplan and Meier.

Stare (SLO) Introduction to EHA 16 / 46

Page 35: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Estimating the survival function

We can use this principle in calculating survival even with censoreddata.

We first divide the time scale into intervals in such a way that events orcensorings occur on the boarders of the intervals.

Then we calculate (conditional) probabilities of surviving each intervaland obtain probability of surviving any time by simply multiplying theprobabilities of survival up to the given point in time.

The method is named after Kaplan and Meier.

Stare (SLO) Introduction to EHA 16 / 46

Page 36: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Estimating the survival function

We can use this principle in calculating survival even with censoreddata.

We first divide the time scale into intervals in such a way that events orcensorings occur on the boarders of the intervals.

Then we calculate (conditional) probabilities of surviving each intervaland obtain probability of surviving any time by simply multiplying theprobabilities of survival up to the given point in time.

The method is named after Kaplan and Meier.

Stare (SLO) Introduction to EHA 16 / 46

Page 37: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The Kaplan-Meier method

610

t=0 3 5 t=10

Stare (SLO) Introduction to EHA 17 / 46

Page 38: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The Kaplan-Meier method

610 · 5

6 = 510

t=0 3 5 t=10

Stare (SLO) Introduction to EHA 17 / 46

Page 39: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The Kaplan-Meier method

510 · 5

5 = 510

t=0 3 5 t=10

Stare (SLO) Introduction to EHA 17 / 46

Page 40: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The Kaplan-Meier method

510 · 3

4 = 38

t=0 3 5 t=10

Stare (SLO) Introduction to EHA 17 / 46

Page 41: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The Kaplan - Meier curve for our example

0 2 4 6 8 10

0.0

0.2

0.4

0.6

0.8

1.0

What do flat regions on the curve mean?

Stare (SLO) Introduction to EHA 18 / 46

Page 42: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The Kaplan - Meier curve for our example

0 2 4 6 8 10

0.0

0.2

0.4

0.6

0.8

1.0

What do flat regions on the curve mean?

Stare (SLO) Introduction to EHA 18 / 46

Page 43: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Another example

DataTime At Risk55 12

61+ 1174 1081 9

93+ 8122+ 7138 6151 5168 4

202+ 3220+ 2238 1

Calculation

S(55) =1112

= 0,917

S(61) =1112· 11

11= 0,917

S(74) =1112· 9

10= 0,825

Stare (SLO) Introduction to EHA 19 / 46

Page 44: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Another example

DataTime At Risk55 12

61+ 1174 1081 9

93+ 8122+ 7138 6151 5168 4

202+ 3220+ 2238 1

Calculation

S(55) =1112

= 0,917

S(61) =1112· 11

11= 0,917

S(74) =1112· 9

10= 0,825

Stare (SLO) Introduction to EHA 19 / 46

Page 45: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Life tables

Year N E L1 110 5 52 100 7 73 86 7 74 72 3 85 61 0 76 54 2 107 42 3 68 33 0 59 28 0 4

10 24 1 8

Stare (SLO) Introduction to EHA 20 / 46

Page 46: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Life tables

HHHHH

HHHHHH

HHHHHH

HHHHHH

����

��

������

���

���

����

��

1 2 3 4

S

S

S

S

F

F

F

F

0,9535

0,9275

0,9152

0,9559

5/107,5 = 0,0465

7/96,5 = 0,0725

7/82,5 = 0,0848

3/68 = 0,0441

Stare (SLO) Introduction to EHA 21 / 46

Page 47: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Plotting survival curves from life tables

● ●

● ● ●

0 2 4 6 8 10

0.0

0.2

0.4

0.6

0.8

1.0

Time (years)

Sur

viva

l pro

babi

lity

Stare (SLO) Introduction to EHA 22 / 46

Page 48: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Illustration - survival after myocardial infarction

0 2 4 6 8 10 12 14

0.0

0.2

0.4

0.6

0.8

1.0

Stare (SLO) Introduction to EHA 23 / 46

Page 49: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Illustration - survival after myocardial infarction

0 2 4 6 8 10 12 14

0.0

0.2

0.4

0.6

0.8

1.0

Stare (SLO) Introduction to EHA 23 / 46

Page 50: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Illustration - survival after myocardial infarction

0 1 2 3 4 5

0.0

0.2

0.4

0.6

0.8

1.0

Stare (SLO) Introduction to EHA 23 / 46

Page 51: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Comparison of survival curves

0 2 4 6 8 10 12 14

0.0

0.2

0.4

0.6

0.8

1.0

menwomen

Stare (SLO) Introduction to EHA 24 / 46

Page 52: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The statistical test for the null hypothesis (that the two samples comefrom the same population) is based on the usual idea:

Under the null hypothesis we expect that people will be dyingproportionally to the group size.

Based on this we calculate the expected number of deaths in eachgroup and compare it to the observed number of deaths.

The name of the test is log rank test for some strange reasons.

The p-value for the log rank test for the previous example is 3,1 · 10−9.

Stare (SLO) Introduction to EHA 25 / 46

Page 53: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The statistical test for the null hypothesis (that the two samples comefrom the same population) is based on the usual idea:

Under the null hypothesis we expect that people will be dyingproportionally to the group size.

Based on this we calculate the expected number of deaths in eachgroup and compare it to the observed number of deaths.

The name of the test is log rank test for some strange reasons.

The p-value for the log rank test for the previous example is 3,1 · 10−9.

Stare (SLO) Introduction to EHA 25 / 46

Page 54: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The statistical test for the null hypothesis (that the two samples comefrom the same population) is based on the usual idea:

Under the null hypothesis we expect that people will be dyingproportionally to the group size.

Based on this we calculate the expected number of deaths in eachgroup and compare it to the observed number of deaths.

The name of the test is log rank test for some strange reasons.

The p-value for the log rank test for the previous example is 3,1 · 10−9.

Stare (SLO) Introduction to EHA 25 / 46

Page 55: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The statistical test for the null hypothesis (that the two samples comefrom the same population) is based on the usual idea:

Under the null hypothesis we expect that people will be dyingproportionally to the group size.

Based on this we calculate the expected number of deaths in eachgroup and compare it to the observed number of deaths.

The name of the test is log rank test for some strange reasons.

The p-value for the log rank test for the previous example is 3,1 · 10−9.

Stare (SLO) Introduction to EHA 25 / 46

Page 56: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The statistical test for the null hypothesis (that the two samples comefrom the same population) is based on the usual idea:

Under the null hypothesis we expect that people will be dyingproportionally to the group size.

Based on this we calculate the expected number of deaths in eachgroup and compare it to the observed number of deaths.

The name of the test is log rank test for some strange reasons.

The p-value for the log rank test for the previous example is 3,1 · 10−9.

Stare (SLO) Introduction to EHA 25 / 46

Page 57: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Log rank test

Say p < 0,01. What does that mean?

Time (years)

Sur

viva

l pro

babi

lity

0 1 2 3

0.0

0.2

0.4

0.6

0.8

1.0

stage I

stage IIstage III

stage IV

Stare (SLO) Introduction to EHA 26 / 46

Page 58: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Log rank test

Say p < 0,01. What does that mean?

Time (years)

Sur

viva

l pro

babi

lity

0 1 2 3

0.0

0.2

0.4

0.6

0.8

1.0

stage I

stage IIstage III

stage IV

Stare (SLO) Introduction to EHA 26 / 46

Page 59: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

How to prepare data

Start date End date Status (failure, no failure)

or

Survival time Status (failure, no failure)

Stare (SLO) Introduction to EHA 27 / 46

Page 60: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Regression models

Linear regression model says

Y ∼ N (α +∑

βiXi , σ2)

This relates the values of Y to the values of Xi . We can not do this insurvival because of censoring.

The problem can be solved by using the hazard function.

Stare (SLO) Introduction to EHA 28 / 46

Page 61: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

1 2 3 4 5

02

46

x

y

● ●

Stare (SLO) Introduction to EHA 29 / 46

Page 62: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

1 2 3 4 5

02

46

x

y

● ●

Stare (SLO) Introduction to EHA 29 / 46

Page 63: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

1 2 3 4 5

02

46

x

y

Stare (SLO) Introduction to EHA 29 / 46

Page 64: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The hazard function

h(t) = lim∆t→0+

P(t ≤ T < t + ∆t |T ≥ t)∆t

S(t) = e−∫ t

0 h(u)du

Stare (SLO) Introduction to EHA 30 / 46

Page 65: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The hazard function

h(t) = lim∆t→0+

P(t ≤ T < t + ∆t |T ≥ t)∆t

S(t) = e−∫ t

0 h(u)du

Stare (SLO) Introduction to EHA 30 / 46

Page 66: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Parametric regression models

We assume some parametric model for the hazard.

Since in sociological research it seems to be difficult to assume acertain parametric model for the data at hand, we will only look at theexponential model.

Then we will turn to the (semiparametric) Cox model.

Stare (SLO) Introduction to EHA 31 / 46

Page 67: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The Cox model

h(t , x) = h0(t)eβx

h1(t , x1)

h2(t , x2)= eβ(x1−x2)

h(t , x + 1)

h(t , x)= eβ

Cox model is often called the proportional hazards model.

Important: the baseline hazard stays unspecified! This is why wesometimes say that the model is semiparametric.

Stare (SLO) Introduction to EHA 32 / 46

Page 68: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The Cox model

h(t , x) = h0(t)eβx

h1(t , x1)

h2(t , x2)= eβ(x1−x2)

h(t , x + 1)

h(t , x)= eβ

Cox model is often called the proportional hazards model.

Important: the baseline hazard stays unspecified! This is why wesometimes say that the model is semiparametric.

Stare (SLO) Introduction to EHA 32 / 46

Page 69: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The Cox model

h(t , x) = h0(t)eβx

h1(t , x1)

h2(t , x2)= eβ(x1−x2)

h(t , x + 1)

h(t , x)= eβ

Cox model is often called the proportional hazards model.

Important: the baseline hazard stays unspecified! This is why wesometimes say that the model is semiparametric.

Stare (SLO) Introduction to EHA 32 / 46

Page 70: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The Cox model

h(t , x) = h0(t)eβx

h1(t , x1)

h2(t , x2)= eβ(x1−x2)

h(t , x + 1)

h(t , x)= eβ

Cox model is often called the proportional hazards model.

Important: the baseline hazard stays unspecified! This is why wesometimes say that the model is semiparametric.

Stare (SLO) Introduction to EHA 32 / 46

Page 71: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

The Cox model

h(t , x) = h0(t)eβx

h1(t , x1)

h2(t , x2)= eβ(x1−x2)

h(t , x + 1)

h(t , x)= eβ

Cox model is often called the proportional hazards model.

Important: the baseline hazard stays unspecified! This is why wesometimes say that the model is semiparametric.

Stare (SLO) Introduction to EHA 32 / 46

Page 72: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

0.0 0.2 0.4 0.6 0.8 1.0

0.0

0.2

0.4

0.6

0.8

1.0

Time

log

haza

rd

B

Stare (SLO) Introduction to EHA 33 / 46

Page 73: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

A typical description of the methods of survivalanalysis

Survival curves were constructed with the Kaplan-Meier method andcompared with the log-rank test. Analyses requiring adjustments forpotential confounding factors were conducted using the Coxproportional hazards method. The proportional hazards assumptionwas tested and satisfied for each mathematical model using Coxanalysis.

Stare (SLO) Introduction to EHA 34 / 46

Page 74: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Example: Cox model fit to MI data

coef exp(coef) se(coef) z page 0.056 1.057 0.004 12.554 0.000sex 0.004 1.004 0.102 0.036 0.970year -0.081 0.922 0.035 -2.295 0.022diabetes 0.488 1.630 0.102 4.781 0.000aspirin -0.335 0.716 0.094 -3.568 0.000reinfarct 0.503 1.653 0.125 4.025 0.000

Likelihood ratio test = 289 on 6 df, p = 0 n = 1017 (23 observationsdeleted due to missing)

Stare (SLO) Introduction to EHA 35 / 46

Page 75: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Example: using the Cox model to compare survivalcurves

Time (years)

Sur

viva

l pro

babi

lity

0 1 2 3

0.0

0.2

0.4

0.6

0.8

1.0

stage I

stage IIstage III

stage IV

Stare (SLO) Introduction to EHA 36 / 46

Page 76: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Example: using the Cox model to compare survivalcurves

We take stage IV to be the reference category.

Stage Stage I Stage II Stage IIII 1 0 0II 0 1 0

III 0 0 1IV 0 0 0

coef exp(coef) se(coef) z pStage III -0.316 0.729 0.202 -1.57 0.120Stage II -0.779 0.459 0.199 -3.92 < 0.001Stage I -1.203 0.300 0.213 -5.64 < 0.001

Stare (SLO) Introduction to EHA 37 / 46

Page 77: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Example: checking the fit

0 2 4 6 8 10 12 14

0.0

0.2

0.4

0.6

0.8

1.0

menwomen

Stare (SLO) Introduction to EHA 38 / 46

Page 78: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Example: checking the fit

Time

Bet

a(t)

for

sex

100 430 920 1500 2100 2900 3700 4500

−1

01

23

●●

●●

●●●

●●

●●●

●●●●●●●●●●●●●

●●

●●

●●●

●●●●

●●

●●●

●●

●●●

●●●

●●

●●

●●●●●

●●●

●●●●●●

●●●●

●●●●

●●●●●

●●●●●●●●●

●●

●●

●●

●●●

●●

●●●

●●●●

●●●●●

●●

●●

●●

●●●

●●

●●●

●●

●●●●●●

●●

●●

●●

●●

●●●●●●

●●

●●●

●●●●●

●●●

●●

●●●

●●

●●

●●

●●●●●

●●

●●

●●

●●●●●

●●●●●●

●●●●●●

●●

●●●●●●

●●

●●

●●●

●●

●●

●●●●

●●●●●

●●●●

●●

●●●●

●●

●●●

●●●●●

●●●

●●●●●

●●

●●

●●

●●

●●

●●

●●●●●●●●●●●●

●●●

●●●

●●

●●●

●●

●●●●

●●●●●●●

●●

●●●

●●●●

●●

●●

●●●

●●●●●●●●

●●●

●●

●●●

●●●●●

●●●●●●●●

●●●●

●●●●

●●●●●●●

●●●●●●●●●

●●

●●

●●●●

●●●●●●●

●●●

●●●●●

●●●●●

●●

●●

●●

●●●●●●●●●●●

●●●●●●

●●●●

●●

●●●●●

Stare (SLO) Introduction to EHA 39 / 46

Page 79: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Time dependent covariates and effects

In its most general form the Cox model can be written as

h(t , x(t)) = h0(t)eβ(t)x(t)

The model easily incorporates time dependent covariates, timedependent effects are more difficult (as they would be in any model).We’ll have a look at an easy method to estimate such effects.

Stare (SLO) Introduction to EHA 40 / 46

Page 80: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Frailties

Basically, we talk about frailties when the true model is, say

h(t , x) = h0(t)eβ1x1+β2x2

but we only measure X1 and omit X2 in the model. Even if X1 and X2are independent, the result changes, sometimes by a lot (unlike inlinear regression).

We can have individual frailties, or frailties pertaining to a group, inwhich case we talk of shared frailties.

Stare (SLO) Introduction to EHA 41 / 46

Page 81: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Repeated events

We’ll look at three approaches:

1 assuming independence2 shared frailties3 stratified model

Stare (SLO) Introduction to EHA 42 / 46

Page 82: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Competing risks

An individual can experience different kinds of events, but only one ofthem (experiencing one prevents him/her to experience another).

Alive1Death from0cardiovascular

causes

other

-

2Death from

causes

SSSSSSw

λ1(t)

λ2(t)

Stare (SLO) Introduction to EHA 43 / 46

Page 83: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Multi state models

Here we also have states that are transitional, i.e. states from which anindividual can exit.

Alive10

Illness

Dead

-

2

SSSSSSw

������/

λ01(t)

λ02(t) λ12(t ,d)

Stare (SLO) Introduction to EHA 44 / 46

Page 84: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

Our published research in Survival Analysis

1 Explained variation in survival analysis2 Linear model of Buckley and James3 Frailties4 Goodness of fit of survival models5 Relative survival6 Multi state models

In this course: 3, 6

Stare (SLO) Introduction to EHA 45 / 46

Page 85: Introduction to Event History/Survival Analysisstat.uns.ac.rs/lectures/survival_intro_2011.pdf · Introduction to Event History/Survival Analysis Janez Stare Faculty of Medicine,

How will the course look like

Approximately half lectures, half labs.Home work.

Course material:

Slides (101 page)Introduction to R textExercisesSolutions to exercises (given AFTER the course)

Stare (SLO) Introduction to EHA 46 / 46