BookmarkSubscribeRSS Feed
guanlinchang
Calcite | Level 5

I am trying to perform a sample size calculation in SAS for a two sample time to event case.

Here is the situation:

1. Assume both sample follows exponential distribution
2. Assume a given constant hazard ratio under alternative hypothesis, we call hr (group 2 vs group 1)
3. We will use logrank test.
4. Given accrual time a, and follow up time f
5. Also given the exponential hazard for group 1, called it exph1
6. Assume the sample size ratio between the two group is 1:1
7. required nominal power is p

Now my code looks like this:

proc power;
twosamplesurvival test=logrank
accrualtime = a
followuptime = f
refsurvexphazard= exph1
hazardratio = hr
power = p
/* eventstotal = . /*events total */
/* ntotal= . /*total sample size */
; 
run;


you can uncomment either eventstotal = . or ntotal=. depending on whether you want to compute the requested number of events, or the actual total sample size.

They should not be the same consider by the end of follow up, if the event does not happen, then the subject will be right censored.

However I am always getting the same number for events total and total sample size. What did I do wrong here?

I actually know how to compute this by hand, and my hand calculation for requested event number is very close to SAS output (SAS gives a slightly larger value but very close), however my total sample size is much larger than the event number.

I could not disclose any particular initial value for the parameters above due to confidential reasons. Could someone help? Would really appreciate that.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 1440 views
  • 0 likes
  • 1 in conversation