АНАЛИЗ ВЫЖИВАЕМОСТИ
SAS/STAT
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
Что такое Анализ Выживаемости и для
решения каких задач его стоит
применять
АНАЛИЗ
ВЫЖИВАЕМОСТИ
Математические основы метода
Какие инструменты Анализа
Выживаемости вы можете найти в
SAS/STAT
Примеры, примеры, примеры...
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
ИСТОРИЧЕСКИЙ ОБЗОР
Анализ
Анализ выживаемости
выживаемости –– набор
набор статистических
статистических методов
методов для
для
предсказания
предсказания как
как факта
факта наступления
наступления события
события,, так
так и
и времени
времени до
до
него
него
Появился около века назад (lifetime tables)
Новый импульс - Cox (proportional hazards
model) в журнале JRSSB-1972: на
сегодняшний день - самая цитируемая
статья по статистике в истории
Главным образом применялся в
клинических исследованиях и
производственном контроле
С большой скоростью набирает
популярность в телекоме и кредитном
скоринге
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
СФЕРЫ ПРИМЕНЕНИЯ
CRM
CRM
Кредитный
Кредитный
скоринг
скоринг
Анализ выживаемости
Планирование
Планирование
маркетинговых
маркетинговых
кампаний
кампаний
Predictive
Predictive Maintenance
Maintenance
Медицина
Медицина
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
Предсказание
Предсказание
оттока
оттока
Оценка
Оценка
эффективности
эффективности
маркетинговых
маркетинговых
кампаний
кампаний
T
Определение
Определение
ключевых
ключевых факторов
факторов
риска
риска
АНАЛИЗ ВЫЖИВАЕМОСТИ VS ТРАДИЦИОННЫЙ DATA MINING
Анализ выживаемости
Наблюдения с
неизвестным исходом
не отбрасываются
Используется
Используется
информация
информация обо
обо
всех
всех объектах
объектах
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
В чем отличие от
традиционных методов
Data Mining?
Помимо самих
факторов, включаем в
модель и их прогнозы
(курсы валют,
динамика поведения)
Модели
Модели точнее
точнее и
и
функциональнее
функциональнее
APPLICATIONS & RESEARCH
SAS
1) Крупный частный латиноамериканский
банк
Система управления рисками
Получение информации о динамике
покупательной способности клиентов во
времени
2) NHS Blood and Transplant
Более эффективное использование скудной
и ценной информации о выживаемости
клиентов после пересадки органов
Аккуратный подбор донора и реципиента
продлевает срок жизни клиентов и
существенно улучшает её качество
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
НЕЗАВИСИМЫЕ ЭКСПЕРТЫ
1) Jonathan Crook
Professor of Business Economics &
Director, MSc Banking & Risk,
Edinburgh
2) Christophe Mues
Senior Lecturer of Southampton
Management School,
Southampton
3) .....и многие, многие другие
активно исследуют
применении Анализа
Выживаемости в кредитном
скоринге и CRM
ОСНОВНЫЕ ОПРЕДЕЛЕНИЯ
Событие: некий триггер, сработавший на «клиенте»
Цензурирование: выбывание из наблюдаемой выборки под действием сторонних
факторов
переезд в другой город, окончание эксперимента до наступления события,
смерть
Ковариаты: характеристики «клиента», влияющие на его «отток»
возраст, пол, город, а также динамика дохода, динамика курсов валют, ... t
ФУНКЦИЯ
ФУНКЦИЯ
ВЫЖИВАЕМОС
ВЫЖИВАЕМОС
ТИ
ТИ
ФУНКЦИЯ
ФУНКЦИЯ
РИСКА
РИСКА
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
S t P T t
P (t T t | T t )
0
h t lim
S t exp h x dx
0
dS t
h t dt
S t
ФУНКЦИЯ ВЫЖИВАЕМОСТИ
S t P T t
t
S t exp h x dx
0
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
ЦЕНЗУРИРОВАНИЕ
Конец
Конец
наблюден
наблюден
ий
ий
А
А что
что
случится
случится сс
ними
ними??
Начало
Начало
наблюден
наблюден
ий
ий
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
Этого
Этого никто
никто
не
не знает
знает
EXPLORATORY DATA ANALYSIS USING
SURVIVAL CURVES
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
KAPLAN-MEIER MODEL
dj
ˆ
S t 1
n
t j t
j
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
Количество выбывших в
интервал времени T
(number at death)
Количество под угрозой
выбывания (number at risk)
KAPLAN-MEIER MODEL : COMPARING SURVIVAL CURVES
Confidence Limits
Different Statistical Tests
-
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
Log Rank
Wilcoxon
Likelihood-Ratio
KAPLAN-MEIER MODEL : DIFFERENT STATISTICAL TESTS
Log
Log Rank
Rank
Wilcoxon
Wilcoxon
Likelihood-Ratio
Likelihood-Ratio
(parametric)
(parametric)
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
Distribution
Distribution of
of Event
Event
times
times Exponential
Exponential
PROC LIFETEST
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
PROC LIFETEST: COMPARING SURVIVAL CURVES
surv01d01.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
PROC LIFETEST: COMPARING SURVIVAL CURVES
Are Hazard Functions proportional?
YES
YES
Does Likelihood-Ratio test applicable?
NO
NO
surv01d01.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
PROC LIFETEST: COMPARING MULTIPLE SURVIVAL CURVES
proc lifetest data=sasuser.methadone
plots=(survival(cb=hw))
notable;
time time*status(0);
strata dose(50 70) / test=logrank
adjust=scheffe nodetail;
title "Scheffe's Multiple Comparisons
Test";
run;
surv01d05.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
PROC LIFETEST: COMPARING MULTIPLE SURVIVAL CURVES
proc lifetest data=sasuser.methadone
plots=(survival(cb=hw))
notable;
time time*status(0);
strata dose(50 70) / test=logrank
adjust=scheffe nodetail;
title "Scheffe's Multiple Comparisons
Test";
run;
Dose
Dose << 50
50 and
and Dose
Dose =60
=60 differ?
differ? NO
NO
Dose
Dose >> 70
70 and
and Dose
Dose =60
=60 differ?
differ? YES
YES
Dose
Dose >> 70
70 and
and Dose
Dose <50
<50 differ?
differ? YES
YES
surv01d05.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
ALTERNATIVE TO KAPLAN-MEIER: LIFE TABLE METHODS
LIFE
LIFE TABLE
TABLE
the
the same
same as
as KaplanKaplanMeier
Meier Estimate,
Estimate, but
but …
…
LARGE
LARGE SAMPLES
SAMPLES
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
GROUP
GROUP
OBSERVATIONS
OBSERVATIONS
INTO
INTO BINS
BINS
CENSORED
CENSORED OBS
OBS
ARE
ARE CENSORED
CENSORED IN
IN
THE
THE MIDDLE
MIDDLE OF
OF
INTERVAL
INTERVAL
ALTERNATIVE TO KAPLAN-MEIER: LIFE TABLE METHODS
proc
proc lifetest
lifetest data=sasuser.methadone
data=sasuser.methadone
plots=(survival(failure)
plots=(survival(failure)
hazard)
hazard)
method=life
method=life
intervals=183
intervals=183 365
365 548;
548;
time
time*status(0);
time time*status(0);
strata
strata clinic
clinic // test=(all)
test=(all) nodetail;
nodetail;
title
"Life
Table
Method
for
title "Life Table Method for Methadone
Methadone
Data";
Data";
run;
run;
surv01d03.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
COX’S PROPORTIONAL HAZARDS MODEL
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
SURVIVAL MODELS
Models
Models in
in Survival
Survival Analysis
Analysis
are
are written
written in
in terms
terms of
of
Hazard
Hazard Functions
Functions
They
They assess
assess the
the relationship
relationship
of
of covariates
covariates to
to survival
survival
times
times
Models
Models can
can be
be parametric
parametric
or
or semi-parametric
semi-parametric
PARAMETRIC
PARAMETRIC
PROC
PROC LIFEREG
LIFEREG
SEMI-PARAMETRIC
SEMI-PARAMETRIC
PROC
PROC PHREG
PHREG
1.
Distribution of Event
Times is specified
1.
Distribution of
Event Times is
unknown
2.
Hazard function is
completely specified
(except for params)
2.
Hazard function is
unspecified
Exp
Exp Hazards
Hazards
Weibull
Weibull Hazards
Hazards
Usually
Usually aa poor
poor
choice!
choice!
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
Cox
Cox Proportional
Proportional
Hazards
Hazards Model
Model
OK
OK for
for !!
COX PROPORTIONAL HAZARDS MODEL
1. The model provides the
primary information
desired from a survival
analysis
2. Minimum of assumptions
3. Robust regression
estimates of the influence of
covariates
4. Thus, the model is
extremely popular
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
PROPORTIONAL HAZARDS ASSUMPTION
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
DERIVING COEFFICIENTS: PARTIAL LIKELIHOOD MAXIMIZATION
ILLUSTRATION
ILLUSTRATION
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
DERIVING COEFFICIENTS: PARTIAL LIKELIHOOD MAXIMIZATION
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
TIED OBSERVATIONS
Tied observations
They must be taken into
account in Partial Likelihood
calculation!
SAS/STAT PROC PHREG
does it automatically!
(Breslow approximation)
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
PROC PHREG
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
PROC PHREG: FIT COX REGRESSION MODEL TO METHADONE DATA
COEFFICIENT
COEFFICIENT
ESTIMATE
ESTIMATE
COEFFICIENT
COEFFICIENT not
not
equal
equal to
to 0?
0?
surv02d01.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
PROC PHREG: ADJUST SURVIVAL CURVES
i X i
S (t , X ) S 0 (t )e
surv02d02.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
COX PH MODEL ASSESSMENT
COX
COX MODEL
MODEL ASSUMPTIONS
ASSUMPTIONS
1.
1. Proportional
Proportional Hazards
Hazards
The
The effect
effect of
of the
the predictor
predictor is
is the
the
same
same over
over all
all values
values of
of time
time
2.
2. Linearity
Linearity
Log
Log Hazard
Hazard linearly
linearly depends
depends on
on
predictors
predictors
3.
3. Additivity
Additivity
The
The joint
joint effect
effect of
of predictors
predictors equals
equals
the
the sum
sum of
of their
their separate
separate effects
effects
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
TIME-VARIABLE
TIME-VARIABLE
DEPENDENCE
DEPENDENCE
CUMULATIVE
CUMULATIVE RESIDUALS
RESIDUALS
PLOT
PLOT
ASSESS PH USING TIME-VARIABLE DEPENDENCE
surv02d04.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
ASSESS PH USING CUMULATIVE RESIDUALS PLOT
RESIDUAL
RESIDUAL
Simulated
Observed
t
CR t obsti exp ti
t i t 0
SIMULATE
SIMULATE IT!
IT!
surv02d04.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
MODELS WITH NON-PROPORTIONAL HAZARDS
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
MODELING NON-PROPORTIONAL HAZARDS
WAYS
WAYS to
to HANDLE
HANDLE NONNONPROPORTIONAL
PROPORTIONAL HAZARDS
HAZARDS
1.
1. Stratified
Stratified Cox
Cox PH
PH
Vary
Vary Baseline
Baseline hazard
hazard
2.
2. Cox
Cox PH
PH with
with time-dependent
time-dependent vars
vars
Model
Model non-proportionality
non-proportionality using
using
interactions
interactions with
with functions
functions of
of time
time
3.
3. Piecewise
Piecewise Cox
Cox PH
PH
The
The effect
effect of
of variable
variable is
is assessed
assessed
separately
separately for
for different
different times
times
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
STRATIFIED COX MODEL
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
STRATIFIED COX MODEL
1. Dose*Clinic & Clinic*Prison
DROP Dose*Clinic
2. Clinic*Prison
DROP Clinic*Prison
surv02d08.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
STRATIFIED COX MODEL
3. No interactions
STAY at this model
complexity
4. Try to adjust Baseline
Hazard by Clinic
surv02d08.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
MODELS WITH INTERACTIONS WITH TIME
2 WAYS of INTRODUCING TIME INTO
PARAMETER ESTIMATES
Change the effect β
of the variable
Change the variable
itself
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
MODELS WITH INTERACTIONS WITH TIME
KEEP
surv02d09.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
PIECEWISE COX MODEL
CREATE INTERACTION with
HEAVISIDE FUNCTION!
0, t tlower ,
H t 1, tlower t tupper ,
0, t tlower
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
PIECEWISE COX MODEL
surv02d09.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
ADVANCED TOPICS
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
TIME-DEPENDENT COVARIATES
New time-dependent
covariates must be specified
inside PROC PHREG
proc phreg data=sasuser.methadone;
class Clinic (param=ref ref='2');
model Time*Status(0)=Clinic Dose
Prison Drink
/ ties=exact rl=pl;
Drink=(0 <= DrinkStart < Time);
title "Single Observation with
Drink as Time Dependent Covariate";
run;
surv03d01.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
MODELING THE EFFECT OF TIME-DEPENDENT PREDICTORS
Coefficients are the same for
the whole survey period
«Drink» is time dependent
and it’s important!
surv03d01.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
REPEATED EVENTS
Some events are intrinsically repeatable: pregnancy, infection
One should account for this in survival analysis
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .
REPEATED EVENTS: DIFFERENT MODELS FOR SUCC EVENTS
Model
Model men’s
men’s muscle
muscle soreness
soreness in
in 44
intervals
intervals depending
depending on
on age
age and
and treatment
treatment
1.
2.
Build
Build different
different
survival
survival models
models for
for
successive
successive events
events
3.
Drop
4.
Drop
surv03d02.sas
C o py r i g h t © 2 0 1 3, S A S In s ti t u te I n c . A l l r i g ht s r e s e r v e d .