Hello, I attempted this problem in SAS Studio, and am not sure if I input the correct code for it. I'd greatly appreciate any help!
Problem:
"For determining sample size estimates for time dependent (survival) data, usually the number of estimated events (D) (e.g. deaths, rejections, relapse, reops, etc.) must first be calculated. Once that is established, the total sample size (n) may be derived based on the percentage of patients that remain event-free at the end of the study."
The two equations for D and n are found below:
These equations are for the (Parametric) version of sample size determination for Survival Data or Time to Failure data.
D = total # of events required
α = Z critical value - Type I error
Β = Z critical value - Type II error
Δ= hazardratio = λΤ/λc = lnπT / lnπC
n=D/(1-%event-free)
Example:
90% Power
Δ = 2.0
D=4(1.96 + 1.282)^2/[ln2]^2 = 87.5 = 88events
This assumes that all participants will be followed until their event.
Suppose that previous studies suggest that 30% of subjects remain event-free at the end of trial. Then, sample size n = D = 88 / (1-0.30) = 125.7 = 126 1 - %event-free
This number might be further inflated to account for dropout, but we won’t worry about that here.
In SAS write code to calculate D and n for the following scenarios:
When alpha = 0.05 and the hazard ratio may be either 2.0 or 1.5, for power = 0.8 and also for power = 0.90. And either 30% or 20% of subjects remain event-free at the end of trial.
Do you see that you will have 8 pair of estimates for D and n in your output? Please include your SAS code. Your estimate for D and n should be in integer form.
Note:
Power ZB
80% 0.84
90% 1.28
Here is my code:
proc power;
twosamplefreq test=fisher
groupproportions= (0.30 0.20)
npergroup=.
power=0.90;
run;
Since the data is survival data, I don't think twosamplefreq is appropriate, Twosamplesurvival is likely more appropriate.
https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2020/4908-2020.pdf
@sascrazedpupil wrote:
Hello, I attempted this problem in SAS Studio, and am not sure if I input the correct code for it. I'd greatly appreciate any help!
Problem:
"For determining sample size estimates for time dependent (survival) data, usually the number of estimated events (D) (e.g. deaths, rejections, relapse, reops, etc.) must first be calculated. Once that is established, the total sample size (n) may be derived based on the percentage of patients that remain event-free at the end of the study."
The two equations for D and n are found below:
These equations are for the (Parametric) version of sample size determination for Survival Data or Time to Failure data.
D = total # of events required
α = Z critical value - Type I error
Β = Z critical value - Type II error
Δ= hazardratio = λΤ/λc = lnπT / lnπC
n=D/(1-%event-free)
Example:
90% Power
Δ = 2.0
D=4(1.96 + 1.282)^2/[ln2]^2 = 87.5 = 88events
This assumes that all participants will be followed until their event.
Suppose that previous studies suggest that 30% of subjects remain event-free at the end of trial. Then, sample size n = D = 88 / (1-0.30) = 125.7 = 126 1 - %event-free
This number might be further inflated to account for dropout, but we won’t worry about that here.
In SAS write code to calculate D and n for the following scenarios:
When alpha = 0.05 and the hazard ratio may be either 2.0 or 1.5, for power = 0.8 and also for power = 0.90. And either 30% or 20% of subjects remain event-free at the end of trial.
Do you see that you will have 8 pair of estimates for D and n in your output? Please include your SAS code. Your estimate for D and n should be in integer form.
Note:
Power ZB80% 0.84
90% 1.28
Here is my code:
proc power;
twosamplefreq test=fisher
groupproportions= (0.30 0.20)
npergroup=.
power=0.90;
run;
@sascrazedpupil wrote:
data fep6; set fep6;
Do not code like this, give it a new data set name such as fep7.
data fep7;
set fep6;
Num_events=(4*(1.96+1.282)**2)/log(2)**2;
sample_size= Num_events/(1-0.30);
run;
proc print data=fep7;
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.