Pythonで学ぶSurvival Analysis
Shae Wang
Senior Data Scientist
統計的推測の一手法
帰無仮説 $H_0$: 例)カリフォルニア州とネバダ州の平均所得は同じ。
対立仮説 $H_1$: 例)両州の平均所得は異なる。
P値:帰無仮説が真なら、このデータが得られる確率は?

$H_0$: $S_A(t)=S_B(t)$
$H_1$: $S_A(t)\neq S_B(t)$
複数の生存曲線

from lifelines.statistics import logrank_testlogrank_test(durations_A, durations_B, event_observed_A, event_observed_B)
.print_summary().p_value.test_statisticプログラムで乳児の発話開始は変わるか?
t.head(2)
id duration observed
0 1 12 0
1 4 6 1
c.head(2)
id duration observed
0 0 11 1
1 2 14 0
lrt = logrank_test(
durations_A = t['duration'],
durations_B = c['duration'],
event_observed_A = t['observed'],
event_observed_B = c['observed'])
lrt.print_summary()
<lifelines.StatisticalResult: logrank_test>
null_distribution = chi squared
degrees_of_freedom = 1
test_name = logrank_test
test_statistic p -log2(p)
0.09 0.77 0.38
lifelines では右打ち切りデータが必要(例:被験者3)pairwise_logrank_test() または multivariate_logrank_test() を使用
Pythonで学ぶSurvival Analysis