6b.8 - SAS Examples

6b.8 - SAS Examples

SAS® Example

Sample Size for Comparing Two Normal Means

An investigator wants to determine the sample size for an asthma equivalence trial with an experimental therapy and an active control. The primary outcome is forced expiratory volume in one second $$\left(FEV_1\right)$$. The investigator desires a 0.05-significance level test with 90% statistical power and decides that the zone of equivalence is $$\left(-\Psi, +\Psi\right) = \left(-0.1 L, +0.1L\right)$$ and that the true difference in means does not exceed $$Delta = 0.05$$ L. The standard deviation reported in the literature for a similar population is $$\sigma = 0.75$$ L. The investigator plans to have equal allocation to the two treatment groups $$\left(AR = 1\right)$$.

***********************************************************************
* This is a program that illustrates the use of PROC POWER to         *
* calculate sample size when comparing two normal means in an         *
* equivalence trial.                                                  *
***********************************************************************;

proc power;
twosamplemeans dist=normal groupweights=(1 1) alpha=0.05 power=0.9 stddev=0.75
lower=-0.10 upper=0.10 meandiff=0.05 test=equiv_diff ntotal=.;
plot min=0.1 max=0.9;
title "Sample Size Calculation for Comparing Two Normal Means (1:1 Allocation)in an Equivalence Trial";
run;

Assuming that $$FEV_{1}$$ has an approximate normal distribution, the approximate number of patients required for the active control group is:

$$n_A = \dfrac{\left(2\right)\left(1.645 + 1. 28\right)^{2}\left(0.75\right)^{2}}{\left(0.1 - 0.05\right)^{2}} = 3,851$$

The total sample size required is $$n_E + n_A = 3,851 + 3,851 = 7,702$$.

SAS PROC POWER yields $$n_E + n_A = 3,855 + 3,855 = 7,710$$.

Try It!
What happens to the total sample size if the power is to be 0.95 and the investigator uses 2:1 allocation?

n = 10,959

Here is the SAS output that you should have gotten:

Fixed Scenario Elements

The POWER Procedure
Equivalence Test for Mean Differences

Fixed Scenario Elements
Distribution Normal
Method Exact
Lower Equivalence Bound -0.1
Upper Equivalence Bound 0.1
Alph 0.05
Mean Difference 0.05
Standard Deviation 0.75
Group 1 Weight 1
Group 2 Weight 2
Nominal Power 0.95
Computed N Total
Computed N Total
Actual Power N Total
0.950 10959

Come up with an answer to this question by yourself and then click on the icon to the left to reveal the solution.

What happens to the total sample size if the power is to be 0.95 and the investigator uses 2:1 allocation?

SAS® Example

Sample Size for Comparing Two Binomial Proportions

An investigator wants to compare an experimental therapy to an active control in a non-inferiority trial when the response is treatment success. She desires a 0.025 significance level test and 90% statistical power. She knows 70% of the active control patients will experience success, so she decides that the experimental therapy is not inferior if it yields at least 65% success. Thus, $$\Psi = 0.05$$ and she assumes that the true difference is $$p_E - p_A = 0$$.

***********************************************************************
* This is a program that illustrates the use of PROC POWER to         *
* calculate sample size when comparing two binomial proportions in a  *
* non-inferiority trial.                                              *
***********************************************************************;

proc power;
twosamplefreq groupweights=(1 1) groupps=(0.65 0.70) alpha=0.025 power=0.9
test=PChi sides=1 ntotal=.;
plot min=0.1 max=0.9;
title "Sample Size Calculation for Comparing Two Binomial Proportions (1:1 Allocation"
title2 "in a Non-Inferiority Trial";
run;


With equal allocation, the number of patients in the active control group is:

$$n_A = \dfrac{\left(2\right)\left(1.96 + 1.28\right)^{2}{0.7\left(1 - 0.7\right)}}{\left(0.05\right)^{2}} = 1,764$$

Thus, $$n_E = n_A = 1,764$$ patients for a total of 3,528 patients.

SAS PROC POWER does not contain a feature for an equivalence trial or a non-inferiority trial with binary outcomes. Fisher’s exact test for a superiority trial can be adapted to yield $$n_E = n_A = 1,882$$ for a total of 3,764 patients. The discrepancy is due to the superiority trial using p-bar = 0.675 instead of 0.7.

Try It!
Suppose the proportions were 0.65 and 0.75. How does the required sample size, n, change?

n = 880 instead of 3684 with Pearson’s Chi Square.

Here is the output for the proportions 0.65 and 0.75.

Fixed Scenario Elements

The POWER Procedure
Pearson Chi-Square Test for Two Proportions

Fixed Scenario Elements
Distribution Asymptotic Normal
Method Normal Approximation
Number of Sides 1
Alpha 0.025
Group 1 Proportion 0.65
Group 2 Proportion 0.75
Group 1 Weight 1
Group 2 Weight 1
Nominal Power 0.9
Null Proportion Differences 0
Computed N Total
Computed N Total
Actual Power N Total
0.900 880

Come up with an answer to this question by yourself and then click on the icon to the left to reveal the solution.

Suppose the proportions were 0.65 and 0.75. How does the required sample size, n, change?

SAS® Example

Sample Size for Comparing Two Hazard Functions

An investigator wants to compare an experimental therapy to an active control in a non-inferiority trial. The response is time to infection. He desires a 0.025-significance level test with 90% statistical power and $$AR =1$$. Follow-up for each patient is one year and he expects 20% of the active control group will get an infection $$\left(p_A = 0.2\right)$$. Although he believes that $$p_E = 0.2$$, he considers the experimental therapy to be non-inferior if $$p_E ≤ 0.25$$. The SAS program below, for a one-sided superiority trial, may approximate the required sample size.

***********************************************************************
* This is a program that illustrates the use of PROC POWER to         *
* calculate sample size when comparing two hazard functions in a      *
* non-inferiority trial.                                              *
***********************************************************************;

proc power;
twosamplesurvival groupweights=(1 1) alpha=0.025 power=0.9 sides=1
test=logrank curve("Placebo")=(1.01):(0.8) curve("Therapy")=(1.01):(0.75)
groupsurvival="Placebo"|"Therapy" accrualtime=0.01 followuptime=1 ntotal=.;
plot min=0.1 max=0.9;
title "Sample Size Calculation for Comparing Two Hazard Functions (1:1 Allocation)";
title2 "in a Non-Inferiority Trial";
run;


The sample size can be worked out exactly. as follows:

Assuming constant hazard functions, then the effect size with $$p_E = p_A = 0.2$$ is $$Lambda = 1$$. With $$p_E = 0.25$$ and $$p_A = 0.2$$, the zone of non-inferiority is defined by:

$$\Psi = \dfrac{\text{log}_e\left(0.75\right)}{\text{log}_e\left(0.8\right)} = 1.29$$

The number of events is $$E = \dfrac{\left(4\right)\left(1.96 + 1.28\right)^{2}}{{\text{log}_e\left(1.29\right)}^{2}} = 648$$

and the sample sizes are $$n_A = \dfrac{E}{\left(AR \times p_E + p_A \right)} = \dfrac{648}{\left(0.2 + 0.2\right)} = 1,620$$ and $$n_E = 1,620$$

Since SAS PROC POWER does not contain a feature for an equivalence trial or a non-inferiority trial with time-to-event outcomes, the results from the logrank test for a superiority trial were adapted to yield $$n_E = n_A = 1,457$$. The discrepancy in numbers between the program and the calculated n is due to the superiority trial using $$p_E = 0.25$$ instead of 0.2 in $$n_A = \dfrac{E}{\left(AR \times p_E + p_A \right)}$$.

Notice that the resultant sample sizes in SAS Examples 7.7-7.9 all are relatively large. This is because the zone of equivalence or non-inferiority is defined by a small value of Ψ. Generally, equivalence trials and non-inferiority trials will require larger sample sizes than superiority trials.

None of SAS Examples 7.7-7.9 accounted for withdrawals. If a withdrawal rate of $$\gamma$$ is anticipated, then the sample size should be increased by the factor $$\dfrac{1}{\left(1 - \gamma\right)}$$.

 [1] Link ↥ Has Tooltip/Popover Toggleable Visibility