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_log_rank_test¶
- biolearn.mortality.calculate_log_rank_test(data, predictor_results)¶
- Calculates the log-rank test for each predictor in the predictor_results DataFrame, adjusted for age. - Parameters:
- data (Dataset) – A Dataset object containing metadata with columns: ‘dead’ - boolean indicating if the subject is 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 ‘age’ - age of the subject at sample collection 
- 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 log-rank test statistics and p-values for each predictor. 
- Return type:
- pd.DataFrame