kmf.survival_function_ (LifeLines Package)
显示了我的队列在不同时间(0,4,6…)的癌症特异性生存(CSS)。128个月)。如何在120个月显示CSS ?
survival_function_at_times()
方法将获得该值。下面是一个带有样本数据集的示例:
from lifelines import KaplanMeierFitter
from lifelines.datasets import load_waltons
data = load_waltons()
T = data['T']
E = data['E']
kmf = KaplanMeierFitter().fit(T, E, label='KaplanMeierFitter')
timeline = [10, 12, 14] # insert 120 and/or any other values here
# directly compute the survival function, returning a pandas Series
kmf.survival_function_at_times(timeline)
# 10 0.96921
# 12 0.96921
# 14 0.95069
# Name: KaplanMeierFitter, dtype: float64