I'm planning a Kaplan-Meier analysis and need to determine an appropriate sample size for the study. I have two treatment arms and want to show that there is a differential biomarker effect depending on the treatment - I expect that the biomarker should be predictive of outcome for one treatment, but have no outcome association in the other.

Calculating the required sample size for each arm individually is fairly straightforward - using a tool like the powerSurvEpi package in R, or the calculator here, I'm able to plug in the desired alpha, beta, as well as the expected hazard ratio and biomarker prevalence to get a sample size for each arm. If all goes well, this should give me a good chance of rejecting the null hypothesis that HR=1 in the biomarker-predictive arm, and also gives sufficient power to show that the failing to reject the null in the biomarker-agnostic arm is actually meaningful. These analyses will show whether or not the observed arm-specific biomarker HRs are significantly different from a fixed value of HR=1.

The question is, what sample size do I need to show that the effects between arms are different from each other? Finding a significant result in the biomarker-predictive arm indicates that the confidence interval of the HR does not cross 1, while no significant result in the biomarker-agnostic arm indicates that the CI of the HR does cross 1. These two CIs may overlap quite a bit, though, so I don't think the sample size for each arm individually is sufficient to show that the arms actually behave differently from each other.

Is there a way to calculate the sample size needed to show that a hazard ratio is different from another, uncertain hazard ratio, rather than being different from a fixed value? This approach would seek to directly compare the HRs between both arms. Another idea would be to perform comparisons within the biomarker-positive or biomarker-negative groups rather than treatment arms, showing that biomarker-positive samples perform differently depending on treatment but that biomarker-negative samples do not. Is either approach preferable, and what's the required sample size?


1 Answer 1


First, remember that non-overlap of 95% confidence intervals is much too stringent for documenting a difference at $p <0.05$. See this answer in the context of a t-test.

What you are asking about seems to be the power to detect a significant interaction term between treatment and biomarker; in an R Cox model you might have:

coxph(Surv(time, status) ~ treatment + biomarker + treatment:biomarker, ...)

A "significant" difference depending on treatment in the association of biomarker with outcome would be evaluated via the regression coefficient for the interaction term, treatment:biomarker.

That model involves estimating at least 3 regression coefficients, depending on how you code biomarker. That's a good deal more complicated than the single regression coefficient that you are implicitly working with in the 2-sample tests handled by simple survival power-calculation tools.

If you want to estimate power for detecting a significant interaction, I thus recommend basing your calculations on simulated survival data. The basic principle is explained in this answer, and implemented for example in the R simsurv package.

That said, you might be worrying too much about that difference depending on treatment in the association of biomarker with outcome. What you really seem to care about is the association of biomarker with outcome in one of the treatment groups. If you are powered for that, how much do you really care whether the biomarker isn't associated with outcome in the other treatment group?

In general, you'll need a much larger sample size to detect a significant interaction, including an interaction term might lower the power to detect the association you care about, and for your power calculations you'll need to specify an estimated association with outcome for both treatment types. That makes the power estimates even more dependent on your assumptions.

So you might be better off just working with the power to detect the expected association of biomarker with outcome in the one treatment group and just accepting whatever you find in the other.

  • $\begingroup$ +1. The goal is to show that the biomarker is treatment-specific, suggesting that the biomarker may have some kind of mechanistic role in drug response (even if not truly causative). A biomarker that's indistinguishably prognostic regardless of treatment is usually just a marker of patient frailty or overall disease severity, but might not give insight as to why patients have different outcomes on different treatments. We'd ideally filter out out these treatment-agnostic factors which have no relationship to the specific drug response, which I think requires analyzing data from both arms. $\endgroup$ Commented Nov 16, 2023 at 14:20
  • $\begingroup$ @NuclearHoagie unless the treatment assignment is random, you will still have a problem with interpretation. You won't be able to distinguish whether the biomarker has a mechanistic role or whether the biomarker works better for patients whose clinical characteristics led to a choice of a particular treatment. In the field I work in, the choice of treatment typically is determined by characteristics of "overall disease severity." $\endgroup$
    – EdM
    Commented Nov 16, 2023 at 16:26
  • $\begingroup$ It is indeed a randomized trial with stratified randomization, so there should not be meaningful differences in clinical characteristics between treatment arms. $\endgroup$ Commented Nov 16, 2023 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.