Method document
Sample size to estimate a hazard ratio per step across ordered groups
How many participants are needed in each of three or more ordered groups to estimate the hazard ratio per step from a Cox model on the group scores, within a chosen factor. Covers non-response.
https://statwisely.com/methods/precision-hr-trend/
When to use it
- A dose–response or exposure-gradient estimate for survival, reported as a hazard ratio per category step.
Not for
- Showing that a trend exists. Use the log-rank test for trend under “Detect an effect”.
Notation
- Participants in each group
- Number of ordered groups
- Survival in the first group at the end of follow-up
- Expected Cox information about the log hazard ratio per step, per participant
- Precision factor: the interval runs from HR / f to HR × f
- Standard normal quantile for confidence 1 − α (1.960 for 95%)
- Non-response rate
Formulas
Participants from the Cox information
Each event contributes the hazard-weighted variance of the group scores among those still at risk; I integrates that over follow-up, with exponential survival censored at its end [1]. At no effect it is the share with an event times the scores’ variance.
Non-response
The number to approach so that n respond. Applied last, after any clustering.
Parameters
Confidence level
Values: 90%, 95% or 99%
95% is the convention in health research. A higher level widens the interval, so the same margin needs a larger sample.
Precision factor
Values: Above 1
1.25 means the interval runs from HR / 1.25 to HR × 1.25.
Survival in the first group
Values: Between 0 and 1
At the end of follow-up.
Number of ordered groups
Values: At least 3
Each is planned the same size.
Expected hazard ratio per stepOptional
Values: Above 0; 1 if left blank
It sets how many events each group has.
Group scoresOptional
Values: One per group; 0, 1, 2, … by default
The hazard ratio is per unit of score.
Expected non-response rateOptional
Values: 0% up to, but not including, 100%
The share of people approached who will not take part; use the response rate of a comparable study. Approaching more people restores the number of respondents, not their representativeness: if non-responders differ, the estimate can still be biased.
Assumptions
- Hazards are proportional and log-linear in the scores; survival is exponential and censored only at the end of a common follow-up.
- Non-response is unrelated to the outcome.
Worked examples
Three groups, no effect assumed
0.6 event-free, factor 1.25: I = 0.4 × 2/3 = 0.267, so n = 1.96² / (3 × 0.267 × (ln 1.25)²) = 96.4, rounded up to 97 per group.
97 per group · Total: 291
Open this example in the calculatorA falling hazard
Expecting 0.8 per step, the later groups have fewer events: I = 0.221 and 117 per group.
117 per group · Total: 351
Open this example in the calculatorValidation
- Every worked example on this page is recomputed by the StatWisely engine whenever the software is built. If a number or formula here stopped matching the calculator, the release would be stopped until this document was corrected.
- Cox models on the scores, fitted to simulated samples at the planned sizes, gave median interval factors of 1.2497 against a target of 1.25. An independent implementation in R recomputes these sizes and is compared with the engine’s.
How to cite
StatWisely. Sample size to estimate a hazard ratio per step across ordered groups. Method document, engine version 1.0.0, reviewed 2026-10-10. https://statwisely.com/methods/precision-hr-trend/
Cite the original references for the formulas your design uses as well.
References
- 1.Collett D. Modelling Survival Data in Medical Research. 3rd ed. Boca Raton: CRC Press; 2015.