MulaiMulai sekarang secara gratis

Log-rank test

After comparing the median survival times of patients with and without pericardial effusion, you also inspected their survival curves visually. To your surprise, the curves actually seem quite similar to each other. Before you finalize your conclusion, it's important to scientifically test this hypothesis. You will use the log-rank test and inspect the p-value to make a decision.

The pandas package is loaded as pd. DataFrames for patients with and without pericardial effusion are loaded and stored as has_pericardial_effusion and none_pericardial_effusion, respectively.

Latihan ini adalah bagian dari kursus

Survival Analysis in Python

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Import logrank_test
from ____ import ____

# Run log-rank test to compare patients with and without pericardial effusion
patient_results = logrank_test(____)
Edit dan Jalankan Kode