The Kaplan-Meier Tab
The Kaplan-Meier tab estimates the survival function nonparametrically and compares groups using RMST (formulation). See Survival Analysis Fundamentals for the mathematical background.
To estimate the effect of covariates on hazard, use The Cox Regression Tab.
Data Requirements
Kaplan-Meier analysis requires two variables:
- Time variable: Time to event (numeric)
- Event variable: Indicates whether the event occurred. The following formats are supported:
- int64: 1 = event, 0 = censored
- Boolean: true = event, false = censored
float64 columns cannot be selected as the event variable. If a column stores 0/1 values as decimals, convert it to int64 with The Convert Column Types Tab.
MIDAS accepts only 0 and 1 (false and true for boolean columns) as event variable values. If your data uses another coding scheme, such as 1 = censored and 2 = event, convert it to 0/1 with the SQL Query Editor tab.
MIDAS accepts values of 0 or more for the time variable. A time of 0 represents an event or a censoring at the start of observation, and both Kaplan-Meier estimation and Cox regression estimation can be computed on data that include time 0. When an event occurs at time 0, the Kaplan-Meier curve drops below 1 at time 0. A negative value points to a time before observation started, so MIDAS treats it as an error in the coding, such as dates subtracted in the wrong order or a missing-value code.
MIDAS cannot tell from the data whether a row with time 0 was in the risk set at the start of observation. In data that record an event that occurred before observation started as time 0, subjects that should not be in the risk set are counted as events at time 0, and the drop in survival probability at time 0 is estimated larger than it is. When many rows have time 0, check how the time origin is defined.
See Survival Analysis Fundamentals for how censoring is handled. MIDAS only supports right censoring. Left censoring, interval censoring, and competing risks are not supported.
Basic Usage
- Select Analysis > Survival Analysis > Kaplan-Meier... from the menu bar
- Select the Time Variable
- Select the Event Variable
- Optionally select a Group Variable for group comparison
- Click Run Analysis
The Group Variable dropdown lists only columns whose scale of measurement is Nominal or Ordinal. A column encoded as 0/1 integers, such as anaemia, is read as numeric and cannot be selected as is. Change its scale of measurement to Nominal in the Data Table tab first. See the Kaplan-Meier tutorial for the steps.

Changing the variable selection, Confidence Level, or the RMST restriction time after a run makes the displayed results no longer belong to the current settings. Restoring the previous settings brings the results back. Changing Dataset also resets the variable selection, so the results are discarded instead.
Understanding Results

Survival Curve
Plots survival probability against time. Displayed as a step function that decreases at each event time. Censoring times are marked with a + symbol on the curve. A + mark on a flat segment indicates that subjects were lost to follow-up during that interval. A pointwise confidence band (95% by default) is shown. A pointwise band consists of individual intervals at each time point and does not guarantee simultaneous coverage of the entire curve, computed using the log transformation method (details).
Adjust the confidence level with the Confidence Level input. The range is 50 to 99.99, and a value outside it is moved to the nearer end when the input loses focus.
Summary Statistics
| Column | Description |
|---|---|
| Group | Group name; All when no Group Variable is specified |
| n | Number of observations |
| Events | Number of events |
| Median | Median survival time, the earliest time when |
| Lower nn%, Upper nn% | Lower and upper bounds of the confidence interval for the median, obtained by inverting the pointwise confidence band of the survival function |
In a group whose estimated survival curve does not fall to 0.5 or below within the observation period, the median is not reached, so MIDAS displays "-" for Median.
MIDAS determines the lower and upper bounds of the confidence interval for the median separately, whether or not the group reaches the median. The lower bound is the earliest time with when the lower confidence limit of the survival function falls to 0.5 or below, and the upper bound is the earliest such time when the upper confidence limit falls to 0.5 or below. MIDAS displays "-" for a bound that has no such time. In a group where Lower nn% holds a value and Upper nn% is "-", only the lower bound of the interval is determined, and the data within the observation period do not determine the upper bound.
Survival at Specified Times
Survival at Specified Times shows, for each group and each time entered in the Times input, the estimate of the survival probability with its standard error and confidence interval. When you report the survival probability at a specific time, such as one-year survival, you can use the values in this table instead of reading them from the curve by eye. The Times input appears in this section of the results after you run the analysis. You can enter several times separated by commas. MIDAS sorts the times in ascending order and removes duplicates. While the input contains a value that cannot be read as a number of 0 or more, the table keeps the previous times.
| Column | Description |
|---|---|
| Group | Group name |
| Time | The time you entered |
| At Risk | Number of subjects in the risk set at time , defined as in Number at Risk |
| Survival | Estimate of : the value at the last event time at or before , and 1 before the first event time |
| SE | Standard error of (Greenwood's formula) |
| Lower nn%, Upper nn% | Lower and upper bounds of the confidence interval for : the pointwise interval by the log transformation method, the same as the confidence band of the survival curve |
Each confidence interval is a pointwise interval constructed separately for one time and one group. When the table lists several times or groups, the intervals are not guaranteed to contain their true values simultaneously, and they are not adjusted for multiplicity. The Greenwood variance is updated only at event times. After a group's last event time, SE and the confidence interval keep their values at that event time even as At Risk decreases, and they do not reflect the smaller risk set.
At a time after a group's last observed time, MIDAS does not estimate and displays "-" for Survival, SE, and the confidence interval, because no subject in the group is observed after that time. In a group whose reached 0 at its last observed time, however, stays 0 afterward, so Survival is displayed as 0. Before a group's first event time, Survival is 1 and SE and the confidence interval are displayed as "-". In this range the Greenwood variance is 0 and the confidence interval degenerates to zero width, which cannot express the uncertainty of the estimate. At a time where , SE and the confidence interval are also displayed as "-", because the Greenwood variance is not defined there.
The times do not change the results of the estimation. Changing them after a run keeps the results in the view, and the table is updated in place. The times are values in the unit of the time variable, so changing Dataset or Time Variable clears them.
Number at Risk
Number at Risk shows, for each group, the number of subjects in the risk set at each time point , that is, the number of subjects whose observed time is at least . Subjects who experienced the event or were censored exactly at are included in this number. The time points are up to 11 points chosen from 0 and the event times of all groups.
RMST (Restricted Mean Survival Time)
The average survival time estimated as the area under the Kaplan-Meier curve from 0 to a restriction time (formulation). Per-group RMST with SE and confidence interval is displayed.
| Column | Description |
|---|---|
| Group | Group name |
| RMST | Restricted mean survival time estimate |
| SE | Standard error (Greenwood variance-based) |
| Lower nn%, Upper nn% | Lower and upper bounds of the confidence interval for RMST (Wald-type) |
| Tau | The restriction time used in the computation, the same value in every row |
MIDAS keeps the confidence interval within the range of RMST, from 0 to .
For a group whose variance estimate is 0, MIDAS does not estimate RMST and displays "-" for RMST, SE, and the confidence interval. The confidence interval would have zero width in this case, which cannot express the uncertainty of the estimate.
Restriction Time
RMST is the area under the KM curve up to , so the choice of affects the result. The default is the upper bound of the range commonly observed across all groups (the smallest of each group's maximum observed time). Change it with the RMST Restriction Time input. Leaving the input empty uses the default. In the interval after the last observed event, the integration assumes the KM curve stays at its last value (this also happens within the maximum observed time when only censoring follows the last event). Because this interval contains no events, the SE and confidence interval of RMST do not include the uncertainty in estimating the hazard over it.
Group Differences
When a Group Variable is specified and there are two or more groups, pairwise RMST differences and their confidence intervals are displayed. MIDAS keeps the confidence interval of a difference within the range of the difference, from to . For three or more groups, the per-pair confidence intervals are unadjusted for multiplicity.
| Column | Description |
|---|---|
| Contrast | The two groups compared, in the form "A − B", where A comes before B in the order of the table |
| Difference | Difference in RMST: the RMST of the earlier group minus the RMST of the later group |
| SE | Standard error of the difference |
| Lower nn% (Unadjusted), Upper nn% (Unadjusted) | Lower and upper bounds of the confidence interval for the difference (Wald-type), not adjusted for multiplicity |
| Tau | The restriction time used in the computation |
The groups are in the same order as the legend of the graph, which is the order of the enum definition for an enum column. Changing the order of the values in the enum definition also changes the direction of the differences.
Notes
- Rows with missing values in the time or event variable are automatically excluded (listwise deletion; see Missing Data Mechanisms for validity conditions).
- Rows whose group variable value is missing are not excluded; MIDAS estimates them as one group. The tables display this group as (missing) in italics and place it last. The Contrast column of RMST Difference shows this group as the text (missing).
Saving as a Dataset
Each of the Summary Statistics, Survival at Specified Times, Number at Risk, RMST, and RMST Difference tables can be saved as a derived dataset with the Save as Dataset button in its heading. SQL, graphs, and report tables can use the saved dataset like any other dataset.
The saved dataset is a derived dataset whose input dataset is the source dataset. The time, event, and group variables, the confidence level of the run, the times of Survival at Specified Times, and of RMST are recorded in this dataset. When MIDAS evaluates this dataset, it uses them to estimate the Kaplan-Meier curve again from the input dataset and builds the row data. When the input dataset changes, for example by Reload Dataset, MIDAS therefore builds the row data again from the new data. MIDAS fixes to the value used in the run, including the default used when the input is empty. On the other hand, when the source data changes so that the maximum observed time of a group becomes shorter than , the recomputed RMST extrapolates the survival curve as constant beyond the last observed time. The note about extrapolation that the tab displays does not accompany the saved dataset.
The saved dataset has the same columns as the table in the tab, except that Number at Risk is saved in a long format with one row per pair of group and time (the columns Group, Time, and At Risk). A value displayed as "-" in the tab and a group displayed as (missing) in the Group column are missing values in the dataset. The text (missing) in the Contrast column is saved as it is.
Adding to Reports
Click Add to Report to add the survival curve to a report.
See also
- Survival Analysis Fundamentals - Mathematical background of time-to-event data, Kaplan-Meier, and Cox model
- The Cox Regression Tab - Estimating the effect of covariates on hazard
- Tutorial: Kaplan-Meier Analysis - A practical example with sample data
Also available as a Markdown file.