How to Fix the Issue of Survival Time Starting from a Negative Value When Creating a Survival Curve

This note explains how to resolve the issue of survival time starting from a negative value when creating a survival curve.

In Exploratory, you can create survival curves using the Kaplan-Meier method. When doing so, survival time is normally expected to start from zero. However, in some cases, it may start from a negative value.

This issue arises when the end date is set earlier than the start date, causing the survival time for each observation to become negative.

The most common solution is to correct or remove the problematic data.

If you want to identify which data is invalid, you can calculate survival time by subtracting the start date from the end date.

Identify and Remove Invalid Data by Calculating Survival Time

To calculate survival time, select the Start Time and End Time columns, then from the column header menu, go to “Between” and select “Days”.

Once the calculation dialog opens, make sure the function is written in the order days_between(Start Time, End Time), then enter any column name you like and click the Run button.

A new column with survival time has now been added.

After the calculation is complete, rows with negative durations represent invalid data.

If you want to remove these rows, use the filter function to set a condition so that only rows with positive survival time are kept.

Export Chart Image
Output Format
PNG SVG
Background
Set background transparent
Size
Width (Pixel)
Height (Pixel)
Pixel Ratio