# Kaplan-Meier Plot Help

## General Help

More information on what a Kaplan Meier analysis is can be found in this article.

### Statistics used

When there are multiple curves or lines in a KM plot, Xena Browser compares the different Kaplan–Meier curves using the log-rank test. The Browser reports the test statistics (𝜒 2) and p-value (𝜒 2 distribution). Data is retrieved in real-time from Xena Hub(s) to a user's web browser and the test is performed in the browser to maintain your data privacy.

The statistics the Xena Browser reports are equivalent to R's survival package, survdiff, with rho=0 (default in R).

### Duplicate samples

Note that we do not automatically remove duplicate patients (for instance if there is a tumor and a normal sample from the same patient). You can determine if there are duplicate patients by looking for the "!" icon next to the p value. Learn how to remove duplicate samples.

### Underlying Data

To visualize and perform a KM analysis, we use two columns of data, _TIME_TO_EVENT and _EVENT.

_TIME_TO_EVENT is a duration variable for each subject having a beginning and an end anywhere along the timeline of the complete study. It begins when the subject is enrolled into a study or when treatment begins, and ends when the end-point (event of interest, for example, death or metastasis) is reached or the subject is censored from the study.

Censoring means the total survival time for that subject cannot be accurately determined. This can happen when something negative for the study occurs, such as the subject drops out, is lost to follow-up, or the required data is not available or, conversely, something good happens, such as the study ends before the subject had the event of interest occur, i.e., they survived at least until the end of the study, but there is no knowledge of what happened thereafter.

_EVENT indicates what the 'event' was for a patient, 1 for the event, for example, death or metastasis, and 0 for censored.

_TIME_TO_EVENT_UNIT: an optional parameter is, e.g. days, months, years, etc. Even though this is per sample, it is expected to be the same across the whole dataset.

Example data:

If you would like the Xena Browser to use your survival data, please name your columns "_EVENT” and “_TIME_TO_EVENT” to help Xena find them.

#### Exceptions

If all patients in a particular group (i.e. line) are censored before any event happens for the whole population (including all the groups), we exclude this group from the statistical analysis and perform the log-rank test on the remaining groups. We do this because we have no way to know the number of people at risk for this particular group at any of event times, and therefore can not compute any statistics for this group. R handles this exception in the same way. Although this group is removed from the statistical analysis, we still display the group in the KM plot.