- Join over
**1.5M+ people** - Join over
**100K+ communities** - Free
**without limits** - Create
**your own community**

Using the example for the CoxPHFitter here: https://lifelines.readthedocs.io/en/latest/fitters/regression/CoxPHFitter.html#lifelines.fitters.coxph_fitter.CoxPHFitter.fit I am getting the following scipy error:

`_fblas.error: (offx>=0 && offx<len(x)) failed for 2nd keyword offx: dnrm2:offx=0`

This is with v0.24.1
it looks like a problem with blas, can you try the advice here? https://github.com/MKLab-ITI/ndvr-dml/issues/17#issuecomment-514904905

Hmm.. no luck. I tried it in a `python:3.6`

docker container and get the same thing.

```
root@b09153018446:/# pip freeze
autograd==1.3
autograd-gamma==0.4.2
cycler==0.10.0
future==0.18.2
kiwisolver==1.1.0
lifelines==0.24.1
matplotlib==3.2.0
numpy==1.18.1
pandas==1.0.1
pyparsing==2.4.6
python-dateutil==2.8.1
pytz==2019.3
scipy==1.4.1
six==1.14.0
```

I did a `pip install lifelines`

to get the above. I don't see scikit-learn or blas.

```
>>> from lifelines import CoxPHFitter
>>>
>>> df = pd.DataFrame({
>>> 'T': [5, 3, 9, 8, 7, 4, 4, 3, 2, 5, 6, 7],
>>> 'E': [1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0],
>>> 'var': [0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2],
>>> 'age': [4, 3, 9, 8, 7, 4, 4, 3, 2, 5, 6, 7],
>>> })
>>>
>>> cph = CoxPHFitter()
>>> cph.fit(df, 'T', 'E')
>>> cph.print_summary()
>>> cph.predict_median(df)
```

This is the example, and I was leaving out the `var`

and `age`

columns as I didn't think they were needed, but apparently they are. It is working now. Sorry for the trouble.
@cyonghui81 you don't really: https://lifelines.readthedocs.io/en/latest/Time%20varying%20survival%20regression.html#short-note-on-prediction

Hi Cameron, I am using the CoxPHFitter and my data consists of one dummy variable. When I use the function plot_covariate_groups, three survival curves are plotted: a) dummy=1, b)dummy=0 and c)baseline_survival.

I am struggling to understand why the baseline_survival is different compared to the survival where dummy=0.

From the theory the baseline_survival is the survival curve where all covariates are 0.

I am struggling to understand why the baseline_survival is different compared to the survival where dummy=0.

From the theory the baseline_survival is the survival curve where all covariates are 0.

@gnikol85 that's a good question. It's depends on how the system defines baseline survival. In lifelines, we define baseline survival not at *zero*, but at the *mean* (there are nice reasons to do this). If you want, you can turn off the baseline plot by setting

`plot_baseline=False`

in `plot_covariate_groups`

Thank you very much Cameron for your response.

I have another question regarding the "conditional_after" arg in the "predict_survival_function".

If I want to predict the survival for the censored subjects at time 55 and suppose the last event time is 50.

Should I use the conditional_after=50 and times=5 or

conditional_after=None and times=55?

What is the difference?

Thank you very much for your time.

I have another question regarding the "conditional_after" arg in the "predict_survival_function".

If I want to predict the survival for the censored subjects at time 55 and suppose the last event time is 50.

Should I use the conditional_after=50 and times=5 or

conditional_after=None and times=55?

What is the difference?

Thank you very much for your time.

However, when plotting the baseline_survival curve, it seems these two negative coefficients are neglected. Could you please confirm that is correct?

Thanks Cameron, I've read that using the Breslow's estimator it's posible to obtain both H0(t) and S0(t) estimates. Since Breslow's estimator is based upon covariate coefficients, I assume S0(t) estimate depends on coefficients from CoxPHFitter. I would seem like S0(t) from baseline_survival might alternatively be obtained from Breslow's estimator, neglecting the negative coefficients...

@gnikol85 exponential/weibull AFT is a particular form of exponential/weibull regression, but the two are often talked about interchangeably. Are you looking for a more exact definition?

Hey @CamDavidsonPilon ,

I have a question about the Cox’s proportional hazard model.

In R I can perform an univariate Cox regression and then a multivariate one. Like in this tutorial: http://www.sthda.com/english/wiki/cox-proportional-hazards-model#compute-the-cox-model

What is the output of cph.print_summary()? If I fit it to a dataset of let's say expressions of miR21, miR126, miR221 and age in years. Then I assume that the output is based on a multivariable calculation. Am I right?

So to perform an univariate Cox regression, I would have to test every variable on its own and fit the CoxPHFitter() to every variable on its own (for example using a forloop)?

I hope you can help.

Cheers Mischa

Hi @DocMischa, i'll answer your questions in sequence:

What is the output of cph.print_summary()

It's like the `summary()`

function in R - it displays the coefficients of the variables provided in the call to `fit(), plus information about log-likelihood, etc.

Am I right?

Your interpretation is correct, yes.

So to perform an univariate Cox regression, I would have to test every variable on its own and fit the CoxPHFitter() to every variable on its own (for example using a forloop)?

that's right!

@gnikol85 only supported in the Cox model atm: https://lifelines.readthedocs.io/en/latest/Time%20varying%20survival%20regression.html

Hi, Cameron -- I've been looking at the lifelines documentation on readthedocs for the last couple of days with no problem, but today it seems that many of the links on the left side of the homepage are currently not working (e.g. all of the links under "Univariate Models" such as https://lifelines.readthedocs.io/en/latest/Survival%20analysis%20with%20lifelines.html). I wondered if maybe the pages are being updated, or if some different issue may be causing this?

I think it's a problem on the host (readthedocs) side: https://zepid.readthedocs.io/en/latest/ also has broken links

hmm, but other RTD sites seem fine...

I am currently debugging, but you can use this PDF in the meanwhile: https://lifelines.readthedocs.io/_/downloads/en/latest/pdf/

Hi everybody, I read here something about a markov model and I'm trying to develop something similar. I have a dataset of activities, with their duration and other parameters and I want to extract the duration of the current activity and what will be the next one using those data. Is there a way to predict it with lifelines? The best way that I could think of so far was to use lifelines to predict the duration and find the next activity with another function, but maybe I overlooked some magical functions :) Any advice would be appreciated :)