Skip to content

Survival Analysis Cox Regression #11

@maurertom

Description

@maurertom

Report

Dear ICBI Team, Dear Gregor!

Thank you so much for taking time to develop this nice tool :). I would also really like to use it in my projects!

I got a question: Is the Cox regression for survival analysis allready integrated in this Version of shears ? From what I see there is only logistic regression in def_test_cell() ?

Or am I just using it wrong?

I tried it like this - would this implementation work?

def _test_cell_cox(formula, df, duration_col, event_col):
    from lifelines import CoxPHFitter
    
    cph = CoxPHFitter()
    cph.fit(df, duration_col=duration_col, event_col=event_col, formula=formula)
    
    cell_weight_coef = cph.params_['cell_weight']
    cell_weight_pval = cph.summary.loc['cell_weight', 'p']
    
    return cell_weight_pval, cell_weight_coef

Thanks for your time and hope the question is not to stupid,
Have a nice day
Thomas

Versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions