2

I need to test, which cox model fits the best based on partial AIC. Below you see the code, that I am using to test the combination of 5 parameters. How can I adjust my code, to test all possible variables combinations?

parameters = ['v1', 'v3', 'v4','v5','CRD','followup']

p = []
for parameter in parameters:
    p.append(parameter)
print(p)


cph = CoxPHFitter()

cph.fit(df[p], duration_col="followup", event_col="CRD", show_progress=True, step_size = .5)

cph.print_summary(decimals = 5)
Mischa
  • 83
  • 1
  • 10
  • Hi @Mischa, I'm not sure, I understand your question – which variables do you want to combine and to test what exactly? Could you maybe give an example of such a combination? – Michal Karbownik Jan 18 '23 at 11:29
  • @MichalKarbownik The aim is to compare different cox models based on partial AIC. For example: v1, v2 vs. v1, v2, v3 and so on. – Mischa Jan 19 '23 at 16:48

0 Answers0