#Getting the strike data as an array dta = sm.datasets.strikes.load() print 'basic data' 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()
#Getting the strike data as an array dta = sm.datasets.strikes.load() print 'basic data' 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()