# Compute sample size & statistical power for a clinical trial in Excel

This tutorial shows how to compute the sample size and power for a clinical trial in Excel using the XLSTAT software.

## What is the power of a statistical test?

When testing a hypothesis using a statistical test, there are several decisions to take:

• The null hypothesis H0 and the alternative hypothesis Ha.

• The statistical test to use.

• The type I error also known as alpha. It occurs when one rejects the null hypothesis when it is true. It is set a priori for each test and is 5 %.

The type II error or beta is less studied but is of great importance. In fact, it represents the probability that one does not reject the null hypothesis when it is false. We cannot fix it up front but, based on other parameters of the model, we can try to minimize it. The power of a test is calculated as 1-beta and represents the probability that we reject the null hypothesis when it is false.

We therefore wish to maximize the power of the test. XLSTAT calculates the power (and beta) when other parameters are known. For a given power, it also allows to calculate the sample size that is necessary to reach that power. The statistical power calculations are usually done before the experiment is conducted. The main application of power calculations is to estimate the number of observations necessary to properly conduct an experiment.

## Goal of this tutorial

This example aims to estimate the necessary sample size in classical clinical trials.
When organizing a trial, the first question that arises is the number of patients to be included in order to obtain statistically valid results.
Three types of trials can be studied:

• Equivalence trials: An equivalence trial is where you want to demonstrate that a new treatment is no better or worse than an existing treatment.

• Superiority trials: A superiority trial is one where you want to demonstrate that one treatment is better than another.

• Non-inferiority trials: A non-inferiority trial is one where you want to show that a new treatment is not worse than an existing treatment.

These tests can be applied to a binary or a continuous outcome.
We will give one example for each type of trial.

## Computing a sample size for clinical trials in XLSTAT

After opening XLSTAT, click the Power icon and choose Clinical trials. Once the button is clicked, the dialog box pops up.

### a. Superiority trial

A new treatment has been obtained and its expected results on patients should be better than the actual treatment. We wish to know the necessary sample size to reject the null hypothesis that both treatments have the same effect.
The outcome is the fact that a patient is cured or not. This is a binary outcome. We suppose that the control group (oldest treatment) has a recovery of 60% and the treatment group (new treatment) has a recovery rate of 70%. We wish to estimate the necessary sample size for an alpha level of 5% and a power of 0.9.
Choose the objective Find the sample size, then select the superiority trial and the binary outcome. The alpha is 0.05. The desired power is 0.9. The % of success for the control group is 60% and the % of success for the treatment group is 70%. There is no cross-over. Once you have clicked on the OK button, the calculations begin and the results are displayed.
The first table shows the main results followed by their interpretation. We can see that 945 patients are required, which means two groups of at least 473 patients.
The simulation plot gives you more information on the evolution of the sample size depending on power. ### b. Equivalence trial

A new treatment has been obtained which has way fewer side effects than the classical treatment. We wish to be sure that both treatments are equivalent. To do so, we should test that both treatments are in the same range of results.
We use equivalence testing. An equivalence limit should be defined. Here, we define an equivalence limit of 10%.
The outcome is the fact that a patient is cured or not. This is a binary outcome. We suppose that the control group (with the oldest treatment) and the treatment group (with the new treatment) have a recovery rate of 60%. We wish to estimate necessary sample size for a level of 5% and a power of 0.9.
Choose the objective Find the sample size, then select the equivalence trial and the binary outcome. The alpha is 0.05. The desired power is 0.9. The % of success for both groups is 60% and the equivalence limit is equal to 10%. Once you have clicked the OK button, the calculations begin and results are displayed.
The first table shows the main results followed my their interpretation. We can see that 1038 patients are necessary, which means two groups of at least 519 patients.
The simulation plot gives you more information on the evolution of the sample size depending on power. ### c. Non-inferiority trial

A new treatment has been obtained; it is cheaper than the actual treatment. We wish to be sure that the new treatment has an at least equal or a little bit less efficient effect than the actual treatment. To do so, we should test that the new treatment is better or slightly worse than the original treatment.
We use non-inferiority testing. A non-inferiority limit should be defined. In our case we define a non-inferiority limit of 8%.
The outcome is the fact that a patient is cured or not. It is a binary outcome. We suppose that the control group (with the oldest treatment) has a recovery rate of 70% and the treatment group (with the new treatment) has a recovery rate of 75%. We wish to estimate the needed sample size for a level of 5% and a power of 0.9.
Choose the objective Find the sample size, then select the non-inferiority trial and the binary outcome. The alpha is 0.05. The desired power is 0.9. The % of success for the control group is 70% and the % of success for the treatment group is 75%. The non-inferiority limit is equal to 8%. Once you have clicked on the OK button, the calculations begin and the results are displayed.
The first table shows the main results followed by their interpretation. We can see that the analysis need to be run on 302 patients to reach a power of 0.9.
The simulation plot gives you more information on the evolution of the sample size depending on power. ## Conclusion

By using XLSTAT Power features, you can obtain the necessary sample size for three types of trials. We have seen that non-inferiority trials are less restrictive but are also more controversial.
XLSTAT enables you to find the power and the sample size when the outcome variable is continuous and to represent many simulation plots. 