# Calculating Sample Size for Non-Inferiority Test in Cox Proportional Hazards Regression With Stratification

I have a binary predictor, X, in a Cox proportional hazards regression model, and I want to show that it is NOT a significant predictor. In other words, I want to show that there is not a significant difference in the predicted hazards (and, equivalently, predicted survival probabilities) between the 2 classes of X. Mathematically,

• if the estimated hazard ratio is H,
• and if my non-inferiority margin is is H_ni,

then I want the sample size that will adequately show that the test of

H_0: H > H_ni

versus

H_a: H <= H_ni

has a P-value that is less than my significance level, alpha.

The complication for this calculation is the existence of 2 other categorical predictors in my model. They are NOT to be fed as predictors. Instead, I want to STRATIFY the model by these predictors. To clarify what I mean by stratification, please see this document.

Here are my inputs

1. Each patient has a time to getting the disease or being censored from the study. Let's call it T.

2. I have a censoring variable that will tell me whether or not an observation was an event or censored at time T. Let's call it C.

3. My binary covariate of interest is X, and it has 2 values: 0 and 1. I seek to show that the hazard ratio for X = 1 to X = 0 is close to zero. In other words, the hazard functions (and, hence, the survival functions) of these 2 groups are the same.

4. The maximum hazard ratio that I will consider to be an insignificant difference between those 2 groups is H_ni. If the hazard ratio for X, H is less than or equal to H_ni, then I would conclude that there is no difference between the 2 groups of interest.

5. Here is the complication: I have 2 other ternary covariates, Y and Z. A colleague said that these 2 covariates predict survival better than X, so I should do this sample-size calculation while stratifying by Y and Z. (I actually don't know why this stratification is needed. If you know why this is helpful, please let me know.) Regardless of whether I understand this or not, I need to run a Cox model that stratifies by these Y and Z.

My questions for you:

A) Can a sample-size calculation be done for this situation? If so, how?

B) How does stratification by Y and Z add value to this model?

• How do you know that Y and Z do not satisfy the PH assumption? Feb 25, 2015 at 19:19
• I don't. As I stated, I don't know why I should stratify by Y and Z - I'm just following the advice. Feb 25, 2015 at 19:34
• 1) Consider revising your first paragraph: a regression coefficient doesn't have a p-value, a test does. And this p-value is a stochastic variable (a function of data), thus, it is not a fixed number. 2) Assuming your model is true, and assuming that the coefficient of this predictor is zero, the probability of a significant result will be $\alpha$, the significance level. Please elaborate, as I think you're looking for something else.
– swmo
Feb 26, 2015 at 16:00
• Thanks, swmo. I have revised my question based on your 2 comments. Feb 26, 2015 at 19:47
• Non-inferiority tests are declared statistically significant if the experimental treatment is non-inferior. This does not mean it is not a significant predictor. Quite the opposite in fact. I'm all the more puzzled you state a two tailed test. Maybe you should be seeking tests of equivalence? Or just fit the Bayesian model Frank Harrell proposed and use it to describe the posterior. May 31, 2018 at 12:54

The frequentist approach to non-inferiority assessment is quite indirect. The Bayesian approach to this is completely straightforward, i.e., compute the posterior probability of non-inferiority, and the sample size can be computed to have a certain high probability that this posterior probability will be definitive (e.g., $\geq 0.95$).

A) What do you mean by "this situation?" If the issue is calculating sample size for a non-inferiority trial with a time-to-event outcome, I suggest chapter 7 of "Chow SC, Wang H and Shao J, 2007. Sample size calculations in clinical research. CRC press." For a software implementation, dunno what software you use, but if Stata, I suggest the ART package ("ssc install art" to install and "h artsurv" for instructions). If the issue is more about the stratification, I would use the same formula, except I plug in my estimate for the stratified hazard ratio.

B) It is hard to say how "stratifying by Y and Z would add value" without knowing more details of the clinical context. Any advice online people might give, however well-intentioned, carries the danger that it may be wrong because we don't have the rest of the story. Hence, I think it is a better idea to get the explanation from the colleague who made the original recommendation. I take no pleasure in saying that in my experience with colleagues who are researchers and PhD candidates, it is disturbingly not uncommon for their supervisors to give advice which is simply wrong, for this is a field where myths are sometimes more prevalent than truths. For this reason, I think "blindly following advice" is often a very bad idea. All I can say is that I use stratification to deal with non-proportional hazards, so I don't see how it would obviously follow from "these 2 covariates predict survival better than X."

Your statement of the test you wish to conduct does not line up with proper frequentist inference of non-inferiority trials. Non-inferiority does not reverse null-hypothesis significance testing. NI trials allow the analyst to conclude that an investigational treatment is/is not non-inferior to a standard of care. If you are not using this language, then the whole analysis is called into question.

1) A quaint formula for sample size calculation for analysis of binary outcomes is given here by:

$$n = \frac{f(\alpha, \beta) \left(\pi_s (100-\pi_s) + \pi_e (100-\pi_e)\right)} { (\pi_s - \pi_e - d)^2}$$

Where $n$ is the target sample size, $\alpha$ is the false positive error rate, $\beta$ is the desired power, $\pi_s$ is the risk of death in the Standard Of Care group, $\pi_e$ is the risk of death in the investigational treatment group, $d$ is the acceptable margin of difference between the two treatments. $f$ is the squared sum of the normal quantile function for the type 1 error rate and the power.

Unfortunately, this introduces a second component to your answer: what's the connection between analysis of binary outcomes and time-to-event? You can reasonably approximate the power of the Cox model by considering the proportion failing at the end of follow-up, making reasonable estimates of attrition/loss to follow-up. You can of course, use simulation with a variety of baseline hazard functions to verify this.

2) Stratification can be done 1 of two ways in a Cox model: via covariate adjustment or by estimating separate baseline hazard functions. Again, the analogous analysis of bivariate data is adjustment logistic regression versus Mantel-Hanszel analysis. In both cases, power/precision is gained by clumping treated/untreated participants into groups defined by risk, but more is spent giving a more general expression of the stratum specific hazard/risk. With full stratification, you use the formula in 1 twice and simply split the power between the two or power strata, then add together the separate $n$ for a total sample size, or (better) use each $n$ for targeted recruitment/blocked randomization.

B) How does stratification by Y and Z add value to this model?

The answer is in that document of yours. If you don't stratify, your model is misspecified because the PH assumption is violated.

As for the sample size calculation, its not very clear what you mean because first you claimed that you wanted to get a p-value.

• 1. Y and Z are not known to violate the PH assumption. I am being advised to stratify by Y and Z for some other reason, but I am not sure what that is. 2. I aim to conduct a sample-size calculation. My comment about the P-value is simply to add a mathematical description of what the Cox model should show if the sample size is adequate. Feb 25, 2015 at 23:34
• Do you imply that if Y and Z were not in the picture, you would know how to do the "sample size calculation"? Feb 26, 2015 at 21:10
• Yes - the software PASS can do that. ncss.wpengine.netdna-cdn.com/wp-content/themes/ncss/pdf/… Feb 27, 2015 at 1:47