Statistical Calculators › Survival Analysis › Cox Proportional Hazards Regression Sample Size Calculator
← All Calculators

Survival Analysis

Cox Proportional Hazards Regression Sample Size Calculator

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.

Study Design Inputs

Enter the assumptions for the covariate whose Cox regression coefficient is being tested.
HR per one-unit increase in X1.
Standard deviation of the covariate.
R² of X1 with the other covariates.
Expected proportion of subjects experiencing the event.

Sample Size Result

Required events determine power; the anticipated event rate converts the required number of events into total sample size.
Enter the design assumptions and click Calculate Sample Size.

Methodology

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).

Required Number of Events

The required number of events is calculated from the normal approximation used for the Wald or score test:

D = (z1−α/2 + z1−β)2 / [(1 − R2) × S2 × B2]    two-sided

D = (z1−α + z1−β)2 / [(1 − R2) × S2 × B2]    one-sided

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.

Total Sample Size

Because not every enrolled subject is expected to experience the event, the required event count is divided by the anticipated overall event rate P:

N = D / P

Required enrollment = ceil(N)

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.

Interpreting the Covariate Inputs

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.

Validation Example

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.

B = 1.0    S = 0.3126    R² = 0.1837    P = 0.738
α = 0.05    Power = 0.80    One-sided

Exact formula calculation:
D = 77.5069 events
N = 77.5069 / 0.738 = 105.0229
Required enrollment = 106

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.

References

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.