АНАЛИЗ ВЫЖИВАЕМОСТИ sas/stat · alternative to kaplan-meier: life table methods...
TRANSCRIPT
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
АНАЛИЗ ВЫЖИВАЕМОСТИ
SAS/STAT
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
АНАЛИЗ
ВЫЖИВАЕМОСТИ
Что такое Анализ Выживаемости и для решения каких задач его стоит применять
Математические основы метода
Какие инструменты Анализа Выживаемости вы можете найти в SAS/STAT
Примеры, примеры, примеры...
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
Анализ выживаемости – набор статистических методов для предсказания как факта наступления события, так и времени до него
ИСТОРИЧЕСКИЙ ОБЗОР
Появился около века назад (lifetime tables)
Новый импульс - Cox (proportional hazards model) в журнале JRSSB-1972: на сегодняшний день - самая цитируемая статья по статистике в истории
Главным образом применялся в клинических исследованиях и производственном контроле
С большой скоростью набирает популярность в телекоме и кредитном скоринге
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
CRM
СФЕРЫ ПРИМЕНЕНИЯ
Оценка эффективности маркетинговых
кампанийКредитный скоринг
Определение ключевых факторов
риска
Анализ выживаемости
Планирование маркетинговых
кампаний
Медицина
Predictive Maintenance
Предсказание оттока
T=?
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
АНАЛИЗ ВЫЖИВАЕМОСТИ VS ТРАДИЦИОННЫЙ DATA MINING
Модели точнее и функциональнее
Анализ выживаемости
В чем отличие от
традиционных методов
Data Mining?
Используется информация обо всех
объектах
Наблюдения с
неизвестным исходом
не отбрасываются
Помимо самих
факторов, включаем в
модель и их прогнозы
(курсы валют,
динамика поведения)
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
1) Крупный частный латиноамериканский банкСистема управления рисками
Получение информации о динамике покупательной способности клиентов во времени
2) NHS Blood and TransplantБолее эффективное использование скудной и ценной информации о выживаемости клиентов после пересадки органов
Аккуратный подбор донора и реципиента продлевает срок жизни клиентов и существенно улучшает её качество
APPLICATIONS & RESEARCH
SAS НЕЗАВИСИМЫЕ ЭКСПЕРТЫ
1) Jonathan CrookProfessor of Business Economics & Director, MSc Banking & Risk,Edinburgh
2) Christophe MuesSenior Lecturer of Southampton Management School,Southampton
3) .....и многие, многие другие активно исследуют применении Анализа Выживаемости в кредитном скоринге и CRM
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
ОСНОВНЫЕ ОПРЕДЕЛЕНИЯ
Событие: некий триггер, сработавший на «клиенте»
Цензурирование: выбывание из наблюдаемой выборки под действием сторонних факторов переезд в другой город, окончание эксперимента до наступления события, смерть
Ковариаты: характеристики «клиента», влияющие на его «отток» возраст, пол, город, а также динамика дохода, динамика курсов валют, ...
tTPtS
)|(lim
0
tTtTtPth
tS
dt
tdS
th
dxxhtS
t
0
expФУНКЦИЯ ВЫЖИВАЕМОСТИ
ФУНКЦИЯ РИСКА
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
ФУНКЦИЯ ВЫЖИВАЕМОСТИ
tTPtS
t
dxxhtS0
exp
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
ЦЕНЗУРИРОВАНИЕ
Начало наблюдений
Конецнаблюдений
А что случится с ними?
Этого никто не знает
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
EXPLORATORY DATA ANALYSIS USING SURVIVAL CURVES
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
KAPLAN-MEIER MODEL
tt j
j
jn
dtS 1ˆ
Количество выбывших в интервал времени T
(number at death)
Количество под угрозойвыбывания (number at risk)
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
KAPLAN-MEIER MODEL : COMPARING SURVIVAL CURVES
Different Statistical Tests
- Log Rank- Wilcoxon- Likelihood-Ratio
Confidence Limits
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
KAPLAN-MEIER MODEL : DIFFERENT STATISTICAL TESTS
Log Rank
Wilcoxon
Likelihood-Ratio(parametric)
Distribution of Event times Exponential
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
PROC LIFETEST
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
PROC LIFETEST: COMPARING SURVIVAL CURVES
surv01d01.sas
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
surv01d01.sas
Are Hazard Functions proportional? Does Likelihood-Ratio test applicable?
PROC LIFETEST: COMPARING SURVIVAL CURVES
YES NO
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
surv01d05.sas
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;
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
surv01d05.sas
PROC LIFETEST: COMPARING MULTIPLE SURVIVAL CURVES
Dose < 50 and Dose =60 differ? NODose > 70 and Dose =60 differ? YESDose > 70 and Dose <50 differ? YES
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;
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
ALTERNATIVE TO KAPLAN-MEIER: LIFE TABLE METHODS
LARGE SAMPLES
LIFE TABLE
the same as Kaplan-Meier Estimate, but …
GROUP OBSERVATIONS
INTO BINS
CENSORED OBS ARE CENSORED IN
THE MIDDLE OF INTERVAL
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
ALTERNATIVE TO KAPLAN-MEIER: LIFE TABLE METHODS
proc lifetest data=sasuser.methadone
plots=(survival(failure)
hazard)
method=life
intervals=183 365 548;
time time*status(0);
strata clinic / test=(all) nodetail;
title "Life Table Method for Methadone
Data";
run;
surv01d03.sas
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
COX’S PROPORTIONAL HAZARDS MODEL
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
SURVIVAL MODELS
Models in Survival Analysis are written in terms of Hazard Functions
They assess the relationship of covariates to survival times
Models can be parametricor semi-parametric
SEMI-PARAMETRICPROC PHREG
PARAMETRICPROC LIFEREG
1. Distribution of Event Times is specified
2. Hazard function is completely specified (except for params)
1. Distribution of Event Times is unknown
2. Hazard function is unspecified
Cox Proportional Hazards Model
OK for !
Exp HazardsWeibull Hazards
Usually a poor choice!
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
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
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
PROPORTIONAL HAZARDS ASSUMPTION
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
DERIVING COEFFICIENTS: PARTIAL LIKELIHOOD MAXIMIZATION
ILLUSTRATION
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
DERIVING COEFFICIENTS: PARTIAL LIKELIHOOD MAXIMIZATION
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
TIED OBSERVATIONS
Tied observations
They must be taken into account in Partial Likelihood
calculation!
SAS/STAT PROC PHREGdoes it automatically!
(Breslow approximation)
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
PROC PHREG
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
PROC PHREG: FIT COX REGRESSION MODEL TO METHADONE DATA
surv02d01.sas
COEFFICIENTESTIMATE
COEFFICIENT not equal to 0?
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
ii XetSXtS
)(),( 0
surv02d02.sas
PROC PHREG: ADJUST SURVIVAL CURVES
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
COX PH MODEL ASSESSMENT
COX MODEL ASSUMPTIONS
1. Proportional HazardsThe effect of the predictor is the same over all values of time
2. LinearityLog Hazard linearly depends on predictors
3. AdditivityThe joint effect of predictors equals the sum of their separate effects
TIME-VARIABLE DEPENDENCE
CUMULATIVE RESIDUALS PLOT
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
ASSESS PH USING TIME-VARIABLE DEPENDENCE
surv02d04.sas
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
ASSESS PH USING CUMULATIVE RESIDUALS PLOT
surv02d04.sas
RESIDUAL
Simulated
Observed
t
tt
tt
i
iiobstCR
0
exp
SIMULATE IT!
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
MODELS WITH NON-PROPORTIONAL HAZARDS
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
MODELING NON-PROPORTIONAL HAZARDS
WAYS to HANDLE NON-PROPORTIONAL HAZARDS
1. Stratified Cox PHVary Baseline hazard
2. Cox PH with time-dependent varsModel non-proportionality using interactions with functions of time
3. Piecewise Cox PHThe effect of variable is assessed separately for different times
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
STRATIFIED COX MODEL
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
STRATIFIED COX MODEL
surv02d08.sas
1. Dose*Clinic & Clinic*Prison
2. Clinic*Prison
DROP Dose*Clinic
DROP Clinic*Prison
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
STRATIFIED COX MODEL
surv02d08.sas
3. No interactions
STAY at this model complexity
4. Try to adjust Baseline Hazard by Clinic
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
MODELS WITH INTERACTIONS WITH TIME
Change the effect βof the variable
2 WAYS of INTRODUCING TIME INTO PARAMETER ESTIMATES
Change the variableitself
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
MODELS WITH INTERACTIONS WITH TIME
surv02d09.sas
KEEP
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
PIECEWISE COX MODEL
CREATE INTERACTION with HEAVISIDE FUNCTION!
lower
upperlower
lower
tt
ttt
tt
tH
,0
,,1
,,0
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
PIECEWISE COX MODEL
surv02d09.sas
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
ADVANCED TOPICS
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
TIME-DEPENDENT COVARIATES
surv03d01.sas
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;
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
MODELING THE EFFECT OF TIME-DEPENDENT PREDICTORS
surv03d01.sas
«Drink» is time dependent and it’s important!
Coefficients are the same for the whole survey period
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
REPEATED EVENTS
Some events are intrinsically repeatable: pregnancy, infection
One should account for this in survival analysis
Copyr i g ht © 2013, SAS Ins t i tu t e Inc . A l l r ights reser ve d .
1.
2.
3. Drop
4. Drop
REPEATED EVENTS: DIFFERENT MODELS FOR SUCC EVENTS
Build different survival models for successive events
surv03d02.sas
Model men’s muscle soreness in 4 intervals depending on age and treatment