Ejemplo n.º 1
0
print('\n')
dta = list(dta.values()[-1])
print(dta[lrange(5), :])
print('\n')

#Create the KaplanMeier object and fit the model

km = KaplanMeier(dta, 0)
km.fit()

#show the results

km.plot()
print('basic  model')
print('\n')
km.summary()
print('\n')

#Mutiple survival curves

km2 = KaplanMeier(dta, 0, exog=1)
km2.fit()
print('more than one curve')
print('\n')
km2.summary()
print('\n')
km2.plot()

#with censoring

censoring = np.ones_like(dta[:, 0])
Ejemplo n.º 2
0
print '\n'
dta = dta.values()[-1]
print dta[range(5),:]
print '\n'

#Create the KaplanMeier object and fit the model

km = KaplanMeier(dta,0)
km.fit()

#show the results

km.plot()
print 'basic  model'
print '\n'
km.summary()
print '\n'

#Mutiple survival curves

km2 = KaplanMeier(dta,0,exog=1)
km2.fit()
print 'more than one curve'
print '\n'
km2.summary()
print '\n'
km2.plot()

#with censoring

censoring = np.ones_like(dta[:,0])