## Learning Outcomes

By the end of this section, students will be able to:

- Explain the key concept of power and what impacts it
- Estimate the power of a given study
- Estimate the sample size needed to test hypotheses in different study designs

You can download a copy of the slides here: A2.4: Sample Size Calculations for RCTs

**Video A2.4 Sample Size Calculation for RCTs (11 minutes)**

## A2.4 PRACTICAL: R

**Sample size calculation for testing a hypothesis (Clinical trials or clinical interventional studies)**

Here is an example:

In a parallel RCT, 25% of the subjects on the standard therapy had a successful outcome. It is only of clinical relevance if a 40% * absolute* improvement is observed in the new therapy. How many subjects are required in order to detect this difference with 80% power at the 5% level of significance?

In this case we need to assess a difference in proportions again, this time with an effect size that has a 0.40 difference between the groups:

> power6<-pwr.2p.test(h=ES.h(p1=0.25, p2=0.65), power=0.8, sig.level=0.05)

> power6

Difference of proportion power calculation for binomial distribution (arcsine transformation)

Â Â Â Â Â Â Â Â Â h = 0.8282914

n = 22.88076

sig.level = 0.05

power = 0.8

alternative = two.sided

NOTE: same sample sizes

23 subjects per group and 46 subjects are required in total.

**Question A2.4: **In the same parallel trial as described in the example above, we still observe that 25% of the subjects on the standard therapy had a successful outcome, but this time it is only of clinical relevance if a 40%

*improvement is observed in the new therapy. How many subjects are required in order to detect this difference with 80% power at the 5% level of significance?*

__relative__**Answer**

First you need to work out what a 40% relative increase on 25% is: 0.25*1.40=35% of subjects would need to have a successful outcome for there to be clinical relevance.

> power7<-pwr.2p.test(h=ES.h(p1=0.25, p2=0.35), power=0.8, sig.level=0.05)

> power7

Difference of proportion power calculation for binomial distribution (arcsine transformation)

Â Â Â Â Â Â Â Â Â h = 0.2189061

n = 327.5826

sig.level = 0.05

power = 0.8

alternative = two.sided

NOTE: same sample sizes

We need many more patients than in the example above due to the small effect size that we now wish to detect.

## A2.4 PRACTICAL: Stata

**Sample size calculation for testing a hypothesis (Clinical trials or clinical interventional studies)**

Here is an example:

In a parallel RCT, 25% of the subjects on the standard therapy had a successful outcome. It is only of clinical relevance if a 40% * absolute* improvement is observed in the new therapy. How many subjects are required in order to detect this difference with 80% power at the 5% level of significance?

power twoproportions 0.25 0.65, alpha(0.05) power(0.80)

*– Estimated sample sizes:

Â Â Â Â Â Â Â Â Â Â Â N =Â Â Â Â Â Â Â 48

Â N per group =Â Â Â Â Â Â Â 24

24 subjects per group and 48 subjects are required in total.

**Question A2.4:**Â

**In the same parallel trial as described in the example above, we still observe that 25% of the subjects on the standard therapy had a successful outcome, but this time it is only of clinical relevance if a 40%**

*improvement is observed in the new therapy. How many subjects are required in order to detect this difference with 80% power at the 5% level of significance?*__relative__**Answer**

First you need to work out what a 40% relative increase on 25% is: 0.25*1.40=35% of subjects would need to have a successful outcome for there to be clinical relevance.

power twoproportions 0.25 0.35, alpha(0.05) power(0.80)

Estimated sample sizes for a two-sample proportions test

Pearson’s chi-squared testÂ

Ho: p2 = p1 Â versus Â Ha: p2 != p1

Study parameters:

Â alpha = Â Â 0.0500

Â Â Â Â power = Â Â 0.8000

Â Â Â Â delta = Â Â 0.1000 Â (difference)

Â Â Â Â Â Â p1 = Â Â 0.2500

p2 = Â Â 0.3500

Estimated sample sizes:

Â Â Â Â Â Â N = Â Â Â 658

Â N per group = Â Â Â 329

We need many more patients than in the example above due to the small effect size that we now wish to detect.

## A2.4 PRACTICAL: SPSS

Sample size calculation for testing a hypothesis (Clinical trials or clinical interventional studies)

In a parallel RCT, 25% of the subjects on the standard therapy had a successful outcome. It is only of clinical relevance if a 40% absolute improvement is observed in the new therapy. How many subjects are required in order to detect this difference with 80% power at the 5% level of significance? **Use the same test as in the previous practical (Independent Samples Binomial Test) but adapt the input values for this scenario.Â **

In the same parallel trial as described in the example above, we still observe that 25% of the subjects on the standard therapy had a successful outcome, but this time it is only of clinical relevance if a 40%Â * relative*Â improvement is observed in the new therapy.

**How many subjects are required in order to detect this difference with 80% power at the 5% level of significance?**

**Answer**

In the first part we calculate thatÂ 24 subjects per group and 48 subjects are required in total when we are looking for 40% absolute difference.

In the second part, we first need to work out what a 40% relative increase on 25% is (0.25*1.40=35%). Therefore 35% of subjects would need to have a successful outcome for there to be clinical relevance.

When we conduct the test we calculate that we need 329 subjects per group and 658 overall.

We need many more patients than in the example above due to the small effect size that we now wish to detect.