Skip to main content
v2026.11,986 entries · CC-BY 4.0

SAS PROC LIFETEST: Survival Analysis Guide

SAS PROC LIFETEST: Survival Analysis Guide PROC LIFETEST is a SAS procedure used for non-parametric survival analysis. It is primarily used to analyze time-to-event data where the event of interest is not observed for all subjects (censored data). In research, this is critical for clinical trials, engineering reliability studies, and any field studying the duration […]

Written and maintained by CASRAI Editorial Board

Published

On this page

SAS PROC LIFETEST: Survival Analysis Guide

PROC LIFETEST is a SAS procedure used for non-parametric survival analysis. It is primarily used to analyze time-to-event data where the event of interest is not observed for all subjects (censored data). In research, this is critical for clinical trials, engineering reliability studies, and any field studying the duration until an occurrence. PROC LIFETEST computes nonparametric estimates of the survival function, most notably the Kaplan-Meier product-limit estimate.

What PROC LIFETEST is used for in research

In research, survival analysis is the primary method for analyzing the time until a specific event occurs. PROC LIFETEST is the go-to tool in the SAS ecosystem for this analysis because it requires no assumptions about the distribution of survival times. Researchers use it to:

  • Estimate survival probabilities over time using the Kaplan-Meier method.
  • Compare survival distributions between two or more groups (e.g., treatment vs. placebo) using rank tests like the Log-Rank test or Wilcoxon test.
  • Calculate median survival times and other quartiles.
  • Handle censored data, where the event of interest did not occur before the end of the study.

How to install or access PROC LIFETEST

PROC LIFETEST is a standard procedure included in the base SAS software installation. It does not require additional modules. You access it by running a SAS program in your SAS environment (e.g., SAS Studio, SAS Enterprise Guide). Ensure your SAS environment is licensed and configured according to official SAS documentation.

How to use PROC LIFETEST step by step

To perform a survival analysis, follow these steps:

  1. Prepare your data: Ensure your dataset has a variable for time-to-event (e.g., days from diagnosis to event) and a censoring indicator variable (e.g., 0 for censored, 1 for event).
  2. Syntax structure:
            proc lifetest data=your_dataset plots=(survival);
                time event_time * censor_var(0);
                strata group_var;
            run;
            
  3. Explanation:
    • DATA=: Specifies the input dataset.
    • TIME: Defines the time variable and censoring variable. The value in parentheses, (0) in this example, indicates that 0 represents a censored observation.
    • STRATA: Optional. Used to compare survival between groups.
    • PLOTS=(SURVIVAL): Requests the Kaplan-Meier survival curve plot.

How to read the output

The output includes several critical tables:

  • Product-Limit Survival Estimates: Shows the survival function estimate at each event time, the number of subjects at risk, and the number of events.
  • Summary Statistics: Provides mean and median survival times, which are essential for comparing treatment efficacy.
  • Rank Tests: Statistical significance of group differences. The Log-Rank test is most commonly used for comparing survival curves across strata.

Troubleshooting PROC LIFETEST

Common issues:

  • Plots not appearing: Ensure ods graphics on; is executed at the start of your SAS session.
  • Censoring error: Double-check that your censoring indicator is coded correctly according to your TIME statement specifications.
  • Dataset not found: Verify your library reference (libref) is correct and the dataset is accessible.

Free alternatives to PROC LIFETEST

Tool Focus
R (survival package) Comprehensive survival analysis, widely used in research.
Python (lifelines) Survival analysis and reliability modeling, intuitive for Python users.

Frequently asked questions

How do I know if my data is censored?

Data is censored if the event of interest (e.g., death, equipment failure) has not occurred for some subjects by the end of the study period, or if they were lost to follow-up.

Can I compare more than two groups?

Yes, the STRATA statement allows you to include multiple groups, and SAS will perform global tests for equality across all groups.

Sources

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about SAS PROC LIFETEST: Survival Analysis Guide

2 free questions a day, no account.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →