Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.

biolearn.mortality.calculate_mortality_hazard_ratios#

biolearn.mortality.calculate_mortality_hazard_ratios(data, predictor_results)#

Calculates mortality hazard ratios for predictor results using a Cox Proportional Hazards model.

Parameters:
  • data (GeoData) – GeoData object. The metadata must contain the following columns ‘age’ - age in years ‘dead’ - 0 for alive, 1 for dead ‘years_until_death’ - if dead this should be years between sample collection and death. Otherwise years between sample collection and last known contact with live subject

  • predictor_results (pd.DataFrame) – The DataFrame containing predictor results. Columns are the name of the predictor model and rows must be ids from data

Returns:

A DataFrame containing hazard ratios, confidence intervals, and p-values for each predictor.

Return type:

pd.DataFrame