Survival Analysis
MIDAS provides two survival analysis methods:
- Kaplan-Meier: Estimate survival curves and compare groups (log-rank test). Visually assess differences in survival between groups and test whether they differ
- Cox Regression: Estimate the effect of covariates on hazard. Evaluate the simultaneous impact of multiple variables on survival time
See Survival Analysis Fundamentals for the mathematical background.
Data Requirements
Survival analysis requires two variables:
- Time variable: Time to event (numeric)
- Event variable: Indicates whether the event occurred. The following formats are supported:
- Numeric: 1 = event, 0 = censored
- Boolean: true = event, false = censored
See Survival Analysis Fundamentals for how censoring is handled.
Kaplan-Meier
The Kaplan-Meier method is a nonparametric estimator of the survival function (formulation).
Basic Usage
- Select 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

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 slider.
Summary Statistics
| Column | Description |
|---|---|
| Group | Group name (when Group Variable is specified) |
| n | Number of observations |
| Events | Number of events |
| Median | Median survival time, the time when . Displayed as NR (Not Reached) if not reached within the observation period |
Confidence interval for the median is not currently reported.
Number at Risk
Shows the risk set size (the number of subjects who have not yet experienced the event and have not been censored) at each time point.
Log-rank Test
Displayed when a Group Variable is specified. Tests the null hypothesis that all groups have equal hazard functions. The log-rank test has maximum power under the proportional hazards assumption. Power decreases when survival curves cross (details).
| Item | Description |
|---|---|
| Chi-squared | Test statistic |
| df | Degrees of freedom (= number of groups - 1) |
| p-value | p-value |
Observed events, expected events under the null hypothesis, and their ratio (O/E) are also shown per group. A group with O/E > 1 experienced more events than expected under the null hypothesis.
Notes
- Rows with missing values in the time or event variable are automatically excluded
Adding to Reports
Click Add to Report to add the survival curve to a report.
Cox Regression
The Cox proportional hazards model is a semiparametric model that estimates the effect of covariates on hazard (formulation and theory).
Basic Usage
- Select Analysis > Cox Regression... from the menu bar
- Select the Time Variable
- Select the Event Variable
- Select one or more Covariates (numeric only)
- Click Run Analysis
To use categorical variables as covariates, convert them with Dummy Coding first.

Understanding Results
Cox Proportional Hazards Regression

The upper coefficients table shows the following columns for each covariate.
| Column | Description |
|---|---|
| Variable | Variable name |
| Coef | Regression coefficient |
| HR | Hazard ratio |
| CI | Confidence interval for the hazard ratio. The column header reflects the selected confidence level (e.g., "95% CI") |
| z | Wald statistic |
| p-value | p-value |
A hazard ratio greater than 1 indicates that an increase in the covariate raises the hazard; less than 1 indicates it lowers the hazard. See Survival Analysis Fundamentals for detailed interpretation.
Below the table, three test statistics are reported.
| Metric | Description |
|---|---|
| Likelihood Ratio Test | Null hypothesis: all . Generally most stable in finite samples |
| Wald Test | Null hypothesis: all . Based on the estimated covariance matrix |
| Score Test | Evaluated at . Can be computed even when convergence is problematic |
The three tests are asymptotically equivalent and yield similar results in large samples. When they disagree in finite samples, prefer the likelihood ratio test. The Wald test is a local approximation based on the curvature of the log-likelihood at the MLE and can become inaccurate when coefficients are large or the likelihood surface is asymmetric. The Score test is evaluated at and loses approximation accuracy when the true values are far from zero. The likelihood ratio test compares log-likelihoods of the null and fitted models directly, without relying on local approximations (details).
Proportional Hazards Diagnostics

Below the coefficients table and model fit statistics, MIDAS displays diagnostics for the proportional hazards assumption. The Cox model assumes that covariate effects are constant over time — this is the proportional hazards assumption (details). When it breaks down, can only be interpreted as a weighted average over time.
Grambsch-Therneau Test
Tests the association between scaled Schoenfeld residuals and time (Grambsch & Therneau, 1994). Uses the KM time transformation .
| Column | Description |
|---|---|
| Variable | Variable name. GLOBAL tests all covariates simultaneously |
| rho | Correlation between scaled Schoenfeld residuals and a Kaplan-Meier-based time transform. Values close to 0 are consistent with the assumption |
| Chi-Squared | Test statistic |
| df | Degrees of freedom. 1 per covariate; number of covariates for GLOBAL |
| p-value | p-value |
When the p-value falls below the pre-specified significance level, the proportional hazards assumption is rejected for that covariate. This indicates that the covariate's effect changes over time. With multiple covariates, check the GLOBAL result first. If GLOBAL is not rejected, a small p-value for an individual covariate may be a chance finding.
Scaled Schoenfeld Residuals
For each covariate, plots scaled Schoenfeld residuals against time. The red curve is a LOESS smooth; the dashed gray line is the estimated coefficient . Under proportional hazards, residuals scatter randomly around and the LOESS line stays close to horizontal. An upward or downward trend in the LOESS line indicates that the covariate's effect varies over time. When visual assessment is uncertain, refer to the p-value from the Grambsch-Therneau test above.
Log-Log Survival Plot
Plots group-specific Kaplan-Meier estimates as versus . Select the grouping covariate from the Grouping Variable dropdown. Continuous variables are split into two groups at the median for visual inspection; this split is a convenience and discards some information from the continuous variable. Under proportional hazards, the curves are approximately parallel. Curves that cross or change their separation over time suggest a violation.
When the proportional hazards assumption is rejected, approaches such as stratified Cox models or time-dependent covariate models can address the violation, but MIDAS does not currently support them. When a violation is detected, interpret results with care, considering the severity of the violation and the goals of the analysis.
Notes
- When convergence fails, a warning is displayed in the results. The Score test can still be computed in this case, providing a basis for assessing model usefulness
- Rows with missing values in the time, event, or any covariate variable are automatically excluded. Compare n (observations) in the results with the original row count to check how many rows were excluded
See also
- Survival Analysis Fundamentals - Mathematical background of time-to-event data, Kaplan-Meier, and Cox model
- Tutorial: Kaplan-Meier Analysis - A practical example with sample data
References
- Grambsch, P. M. and Therneau, T. M. (1994). Proportional hazards tests and diagnostics based on weighted residuals. Biometrika, 81(3), 515--526. https://www.jstor.org/stable/2337123