PROC POWER ;=DIFF
TWOSAMPLEMEANS TEST=8
MEANDIFF=15
STDDEV=.
NTOTAL=0.8
POWER
; RUN;
Sample Size for Superiority Trials in SAS
SAS has 2 procedures for doing Sample size. A basic summary is provided here based on Jenny Cody’s paper1 , but see the paper itself for more details. There are also many available options to best to consult SAS online support for PROC POWER2 and PROC GLMPOWER3.
PROC POWER is used for sample size calculations for tests such as:
t tests, equivalence tests, and confidence intervals for means,
tests, equivalence tests, and confidence intervals for binomial proportions,
multiple regression,
tests of correlation and partial correlation,
one-way analysis of variance,
rank tests for comparing two survival curves,
logistic regression with binary response,
Wilcoxon-Mann-Whitney (rank-sum) test (SAS, 2010).
PROC GLMPOWER is used for sample size calculations for more complex linear models, and cover Type III tests and contrasts of fixed effects in univariate linear models with or without covariates. (SAS, 2011).
Comparing means for parallel design (unpaired)
In the most common scenario SDs are assumed known and the same in both treatment groups. Otherwise Student t distribution is used instead of the normal distribution. SAS follows the Satterthwaite method.
Example: Sample size for comparison of 2 independant treatment group means with same known SDs
A client is interested in conducting a clinical trial to compare two cholesterol lowering agents for treatment of hypercholesterolemic patients. The primary efficacy parameter is a low-density lipidprotein cholesterol (LDL-C). Suppose that a difference of 8% in the percent change of LDL-C is considered a clinically meaningful difference and that the standard deviation is assumed to be 15%. What sample size is required for a two-sided false positive rate of 5% and a power of 80%?
The code below estimates the sample size in SAS. NOTE: you can either specify the MEANDIFF=8 or if you know the separate group means X and Y, you can use GROUPMEANS =X|Y code instead. SAS also assume a default alpha level of 0.05, a 1:1 balanced randomization and a Normal distribution.
As shown below, a total sample size of 114 is recommended, which equates to 57 in each group.
Comparing means for crossover design (paired)
It is important to differentiate here between the within patient SD and the SD of the difference. We may need to recalculate one to the other, depending on the case.
Variance of the difference = 2x Variance within patient. Vardiff=2∗Varpatient
Example
We wish to run an AB/BA single dose crossover to compare two brochodilators. The primary outcome is peak expiratory flow, and a clinically relevant difference of 30 l/min is sought with 80% power, the significance level is 5% and the best estimate of the within patient standard deviation is 32 l/min. What size of trial do we require? (After recalculating: 32∗2=45 and assuming no period effect and assuming between each pair of measurements on the same subject that we have a 0.5 correlation)
PROC POWER ;=DIFF
PAIREDMEANS TEST=.
NPAIRS=0.5
corr=30
MEANDIFF=45
STDDEV=0.8
POWER
; RUN;
References
- Sample Size Calculation Using SAS®, R, and nQuery Software, 2020 Jenna Cody, Paper 4675-2020
- PROC POWER SAS online help https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_power_sect010.htm
- PROC GLMPOWER SAS online helphttps://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_glmpower_a0000000154.htm
Version
─ Session info ───────────────────────────────────────────────────────────────
setting value
version R version 4.4.2 (2024-10-31)
os Ubuntu 24.04.2 LTS
system x86_64, linux-gnu
ui X11
language (EN)
collate C.UTF-8
ctype C.UTF-8
tz UTC
date 2025-04-16
pandoc 3.4 @ /opt/quarto/bin/tools/ (via rmarkdown)
─ Packages ───────────────────────────────────────────────────────────────────
! package * version date (UTC) lib source
R sample_s_superiority <NA> <NA> [?] <NA>
[1] /home/runner/work/CAMIS/CAMIS/renv/library/linux-ubuntu-noble/R-4.4/x86_64-pc-linux-gnu
[2] /opt/R/4.4.2/lib/R/library
R ── Package was removed from disk.
─ External software ──────────────────────────────────────────────────────────
setting value
SAS 9.04.01M7P08062020
──────────────────────────────────────────────────────────────────────────────