Questions tagged [lifelines]

Use when discussing the library's statistical outputs. For questions about "how do I....", questions should be asked on StackOverflow instead.

a survival analysis library in Python.

22 questions
5
votes
1 answer

How does lifelines calculate baseline hazard in CoxPHFitter?

I have learnt that the baseline hazard function in the Cox PH Model is unspecified. Does it mean that I can specify it as any functions and select the best one during experiments? I also see that the CoxPHFitter function in the lifelines does not…
Munichong
  • 1,645
  • 3
  • 15
  • 26
4
votes
1 answer

Python Astronomy Censored Data in Lifelines

I am trying to find a correlation between a given data set containing redshifts and turnover frequencies (I have a list of 320 galaxies, and the redshift and turnover frequency (a turnover frequency is the frequency of the peak in the radio…
Matt Majic
  • 163
  • 4
3
votes
2 answers

Predictions using CoxTimeVaryingFitter for survival analysis in Python

For a customer churn analysis , i am building a time varying cox model in Python (available under lifelines package) to predict survival probabilities. The model object CoxTimeVaryingFitter() currently does not support or include functions to…
swat
  • 31
  • 1
2
votes
1 answer

I cannot match the results of KaplanMeier and Nelson Aalen by hand

I have fitted both models by using lifelines python library. The results of .event_table from both models are identically matched. However, when I try to recalculate .cumulative_density_ from KaplanMeierFitter() and .cumulative_hazard_ from…
2
votes
1 answer

Should the data be balanced for Kaplan-Meier survival curve?

I have a dataset that contains some categorical info about my users (like gender and country), whether they have churned or not and what's the time from their subscription to churn. I want to use survival analysis and estimate the time between…
2
votes
2 answers

complex survey in python

I have been using the excellent R survey package for survival analysis of complex survey data. I have the necessity to migrate to python, and have found that the Python package lifelines gives the possibility to define sampling weights and clusters…
giotto
  • 143
  • 7
2
votes
1 answer

Difference between KaplanMeierFitter plots() in Lifelines

I have been using Lifelines library for survival analysis. I observed a difference in the plots using the Kaplan Meieir Fitter estimator on my data. The above plot of the data, provides a step function using the KMF estimator. While calling…
keshr3106
  • 35
  • 1
  • 8
1
vote
1 answer

How lifelines calculates p-values in CoxPHFitter summary?

I would like to understand how term-specific p-values are calculated in the lifelines package ('p' in the summary table below). The documentation says they are calculated using stats.chi2.sf(U, 1), but I don't understand how exactly this works. Is…
vimegace
  • 13
  • 3
1
vote
1 answer

Interpreting output of predict_survival_function

I am attempting to model individuals in the Rossi dataset. Looking at this we see that the output of the predict_survival_function gives us a a dataframe with the index being the time point and the column is the individuals survival probability. If…
Kevin
  • 179
  • 1
  • 6
1
vote
1 answer

Convergence Error Using lifelines.CoxTimeVaryingFitter Python

I want to evaluate my Cox model using the lifelines package for a time varying covariate problem. However, when I use the lifelines.CoxTimeVaryingFitter I get a convergence error. I have already transformed my dataset into long_format, moreover…
Josh
  • 137
  • 1
  • 1
  • 10
0
votes
1 answer

Transform Survival function of Cox Proportional Hazards Model to single risk score

I am working on a churn prediction in Python using lifelines based on the Telco Dataset. I managed to create survival functions of the subject within the dataset (see screenshot). However, I want to compare my subjects to each other based on a…
0
votes
1 answer

Survival Regression using Stratification vs Partial Effects in Lifelines

I have been using the Lifelines survival estimation package: https://lifelines.readthedocs.io/en/latest/ I am interested in the effect that a specific variable (number of pain sites) has on the survival model (using the CoxPH model). I tried…
Gustopher
  • 1
  • 1
0
votes
1 answer

Testing the validity of a Cox Time-Varying regression model in Python Lifelines

Using the lifelines library for python, I've fitted a Cox Time-varying regression to some customer data, to see which coefficients have an effect on customer churn. The dataset is a combination of time-independent and time-dependent variables. The…
0
votes
1 answer

Survival model predictors with shorter observation time

Can you help me understand how to deal with survival model feature selection: I am trying to predict median for lifetime for consumers, based on panel data (i.e. regular answers from a representative sample answering if they are still using the…
0
votes
1 answer

what is the output of predict_survival_function method in lifelines package?

I'm using predict_survival_function method in lifelines package and I want to have the conditional survival function of each individual in my dataset. The dataset includes some users feature, the weeks from signup to churn and whether they churn or…
1
2