Open timscorbett opened 1 year ago
What is the survival function of an AFT model? The AFT model is conditional (i.e requires covariates). Maybe you want predict_survival_function
?
I see an example here on page 11-12 https://buildmedia.readthedocs.org/media/pdf/lifelines/latest/lifelines.pdf
That's the WeibullFitter
, not WeibullAFTFitter
Ah! thank you. How can I get the baseline curve alone? At this time, my only covariate is a continuous one. I will use the partial feature after augmenting the dataset.
On Thu, Sep 28, 2023 at 5:26 PM Cameron Davidson-Pilon < @.***> wrote:
That's the WeibullFitter, not WeibullAFTFitter
— Reply to this email directly, view it on GitHub https://github.com/CamDavidsonPilon/lifelines/issues/1562#issuecomment-1740154970, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQJMZPRCFFESSINWQOOPODX4YIT7ANCNFSM6AAAAAA5LPF4UI . You are receiving this because you authored the thread.Message ID: @.***>
How can I get the baseline curve alone
There's not really a baseline curve for AFT models (terminology isn't used), but I think you just want to set the covariate to 0 in predict_survival_function
.
Never mind, I added a relevant constant column T.
How do I get the CDF relative to this conditional variable from plot_partial_effects_on_outcome? 1 - weibull_aft.predict_survival_function('T') ?
Where can I give the T range as given in plot_partial_effects_on_outcome?
As well how do I say, I need these for times t=1..10 ?
I see predict_survival_function() gives me as many curves as there are rows in the df. Can there be one prediction per T and one single prediction for the baseline?
The first three questions can be answered by checking out the docs: https://lifelines.readthedocs.io/en/latest/fitters/regression/WeibullAFTFitter.html?highlight=plot_partial_effects_on_outcome#lifelines.fitters.weibull_aft_fitter.WeibullAFTFitter.plot_partial_effects_on_outcome
I don't quite understand your 4th question, however
That helps. Thanks Cam!
I guess I can get the cumulative distribution function (CDF) as 1-survival from the plot collection of partials.
Is there a confidence interval band fill between for the survival plot? If not, how can I get it?
Is there a confidence interval band fill between for the survival plot? If not, how can I get it?
Unfortunately, not
Under what conditions is the cumulative_hazard < hazard? My plots have t = 0 to 6. The Y for hazard rate goes up to 750 at t=6. THe Y for cumulative hazard goes only up to 450 at t=6 The survival plot looks as expected..
On Sat, Sep 30, 2023 at 3:15 PM Cameron Davidson-Pilon < @.***> wrote:
Is there a confidence interval band fill between for the survival plot? If not, how can I get it?
Unfortunately, not
— Reply to this email directly, view it on GitHub https://github.com/CamDavidsonPilon/lifelines/issues/1562#issuecomment-1741870723, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQJMZNT4D363SP4OXZKTPDX5CKWVANCNFSM6AAAAAA5LPF4UI . You are receiving this because you authored the thread.Message ID: @.***>
cumulative hazard (t) = int_0^t hazard(s) ds
so it's possible for cumulative_hazard < hazard. Think about how a short spike in a function might affect its integral.
Thanks Cam. If my input data itself is in log10 and the shape is:
coef exp(coef)
rho_ Intercept 2 9
Is it safe to say, my antilog(rho_) for interpretation is 10^(2) and not 10^(9)?
On Tue, Oct 3, 2023 at 2:19 PM Cameron Davidson-Pilon < @.***> wrote:
cumulative hazard (t) = int_0^t hazard(s) ds
so it's possible for cumulative_hazard < hazard. Think about how a short spike in a function might affect its integral.
— Reply to this email directly, view it on GitHub https://github.com/CamDavidsonPilon/lifelines/issues/1562#issuecomment-1745742074, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQJMZOHNEKIIZ4BQKY3MHDX5R6NDAVCNFSM6AAAAAA5LPF4UKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBVG42DEMBXGQ . You are receiving this because you authored the thread.Message ID: @.***>
Sure, yea, but you should expect very small variation in your log10 variable as a consequence.
Is the plot_partial_effects_onoutcome same as a regular weibull(1.75,2.24) plot conditional on T? Here shape (rho) = 2.24 and scale (lambda) = 1.75; based on the results below My intent is to get upper and lower confidence interval curves for this partial effect based on the interval you provide for rho.
(By the way, there is some literature on confidence intervals for Cox PH survival with covariates. Not sure if those are conditional on a covariate. https://www.jstor.org/stable/2530904)
For WeibullAFT, why does not predict_survival_function have partial outcomes?
On Thu, Oct 5, 2023 at 3:51 PM Cameron Davidson-Pilon < @.***> wrote:
Sure, yea, but you should expect very small variation in your log10 variable as a consequence.
— Reply to this email directly, view it on GitHub https://github.com/CamDavidsonPilon/lifelines/issues/1562#issuecomment-1749761816, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQJMZOGANFWD5USMNRK67DX542WXAVCNFSM6AAAAAA5LPF4UKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBZG43DCOBRGY . You are receiving this because you authored the thread.Message ID: @.***>
Is this a known issue? Is there a workaround?
Traceback (most recent call last): File "lifelines_example.py", line 31, in
weibull_aft.plot_survival_function(ax=axes[0][0])
AttributeError: 'WeibullAFTFitter' object has no attribute 'plot_survival_function'