Survival Analysis
Estimate the number of events and total subjects required to detect a specified Cox regression effect using the Hsieh–Lavori sample-size formula. The calculation accounts for the hazard ratio, covariate variability, correlation with other covariates, anticipated event rate, significance level, and desired power. Runs entirely in your browser.
This calculator implements the Hsieh and Lavori (2000) sample-size formula for testing a single regression coefficient in a Cox proportional hazards regression model. The model relates the log hazard to one or more covariates, with the coefficient of interest denoted by B. For a hazard ratio specified per one-unit increase in X1, the corresponding coefficient is B = log(HR).
The required number of events is calculated from the normal approximation used for the Wald or score test:
Here, D is the required number of events, S is the standard deviation of the covariate of interest, and R2 is the proportion of its variance explained by the remaining covariates in the model. The term (1 − R2) therefore represents the residual variation in the covariate available for estimating its unique Cox regression effect.
Because not every enrolled subject is expected to experience the event, the required event count is divided by the anticipated overall event rate P:
The final sample size is rounded upward to the next whole subject. The calculation therefore separates the number of events needed for statistical information from the number of subjects that must be enrolled to obtain those events.
The hazard ratio is converted internally to the Cox regression coefficient B = log(HR). For a continuous covariate, enter its anticipated standard deviation directly. For a binary covariate coded 0/1, the standard deviation can be obtained from the anticipated proportion p in the 1 category as sqrt[p(1 − p)]. For example, a balanced 0/1 treatment indicator has S = 0.5.
The R2 adjustment is important in a multivariable Cox model. Increasing correlation between the covariate of interest and the remaining covariates reduces the independent information available for estimating its coefficient and consequently increases the required number of events.
Important assumption: The Hsieh–Lavori formulation assumes that the proportional hazards model is appropriate. It does not require exponentially distributed survival times. The formula is an asymptotic approximation and should be supplemented by simulation when the planned design has unusual features or when finite-sample behavior is important.
The this method Cox Regression documentation provides a published validation example based on Hsieh and Lavori (2000). The inputs are: B = 1.0, S = 0.3126, R2 = 0.1837, event rate P = 0.738, one-sided alpha = 0.05, and power = 0.80. Hsieh and Lavori reported N = 107.
This yields 106 using the unrounded calculation, while noting that Hsieh and Lavori obtained 107 because of intermediate rounding. This calculator uses the unrounded quantities throughout and therefore reproduces the current this method calculation of 106 subjects for this validation example.
Hsieh, F.Y. & Lavori, P.W. (2000). “Sample-Size Calculations for the Cox Proportional Hazards Regression Model with Nonbinary Covariates.” Controlled Clinical Trials, 21(6), 552–560.
Schoenfeld, D.A. (1983). “Sample-Size Formula for the Proportional-Hazards Regression Model.” Biometrics, 39(2), 499–503.
the software, LLC. this method Sample Size Software, Chapter 850: Cox Regression. the relevant methodological literature presents the Hsieh–Lavori formula, describes the Cox regression hypothesis test, and provides validation examples against the published Hsieh and Lavori calculations.