How to calculate sample size from hazard ratio?

The marker gene XYX1 being high in breast cancer is associated with poor prognosis with higher hazard ratio : 3.5. I want to calculate sample size with 1 - β (power) = 80%, one sided, type I error? How to perform sample size calculation and arrive at the number of samples? What are the other requirements?

• There's lots of online calculators and explainers for this. In short, you'll need to know the smallest hazard ratio you want to detect and the prevalence of your marker gene in the study sample. This gives you the number of events you should aim to detect, so to turn this into a number of participant to include you'll need to know in what proportion of participants you expect to observe an event (which in turn depends on the follow-up length, median death rate, risk of censoring). Commented Feb 9 at 9:07

The key reference here is Schoenfeld (1983), who gives the following formula:

$$\frac{(z_{1-\beta}+z_{1-\alpha})^2}{pA\times pB\times\text{log}(\text{HR})^2}$$

This will give you the number of events you'll have to observe for a proportional hazards test with type I & II error rates of $$\alpha$$ and $$\beta$$ ($$z$$ their standard normal quantiles), group allocation proportions $$pA$$ and $$pB$$ (so $$pA+pB=1$$), and an assumed hazard ratio $$\text{HR}$$.

Plugging in your assumption, using the standard $$\alpha=0.05$$, $$1-\beta=0.80$$, and balanced allocation (unbalanced will reduce power) you'll get $$\frac{7.8488}{0.5\times 0.5 \times 1.5694}\approx 20$$ observed events needed.

The next question is how you get to those 20 events. Because you may lose subjects to follow-up it's not likely that you can just start with, say, 16 subjects per arm - you expect to see a significant majority of your 20 events in one of those arms - and wait till everyone has had the event: this may result in far fewer than 20 events actually being observed if any loss to follow-up occurs. It's also not likely that you can just keep recruiting subjects until you've observed 20 events at some point in their follow-up, this will lead to far more subjects being enrolled and still in follow-up than are needed to get to your desired power.

To strike a balance between these two extremes you need additional assumptions on how fast you can accrue subjects, and how likely they are to drop out of your study prior to having the event (i.e. being censored). This will allow you to convert the number of required events into a reasonable number of required subjects.

Finally, as was mentioned in the comments there's really quite a few explainers out there, see for example this calculator that'll just let you plug in numbers. This site also has a lot of discussion on more complicated scenarios, where simulations would be a go-to method for determining operating characteristics.