```Date: Fri, 24 Sep 2010 14:27:00 -0700 Reply-To: Paul Miller Sender: "SAS(r) Discussion" From: Paul Miller Subject: Re: Sample size calculation for non-inferiority test of differences between means Comments: To: Robin R High In-Reply-To: Content-Type: text/plain; charset=iso-8859-1 Hi Robin,   This is great! Nice to see I wasn't too far off base and that there is in fact a better way of doing it.   I had asked about the possibility of using survival analysis but was told no. Recovery time is quite rapid and so censoring is expected to be non-existent or virtually so.   If censoring had been an issue, I was going to use a "non-inferiority log rank test."   Am I right in thinking that this would be the test to use? And if so, do you know how to perform this test? I had looked around but couldn't find much about how to do this using SAS.   Thanks,   Paul  --- On Fri, 9/24/10, Robin R High wrote: From: Robin R High Subject: Re: Sample size calculation for non-inferiority test of differences between means To: "Paul Miller" Cc: SAS-L@LISTSERV.UGA.EDU Received: Friday, September 24, 2010, 3:57 PM Paul, I wouldn't quibble too much about the precise standard deviation, since power is an approximation based on population parameters, of which the sample estimate is often reasonable for a ballpark figure (depending on how big is your ballpark), so you are on the right track (though I wonder if survival analysis would be better for this example than a t-test?) DATA sss; n1=120; n2=125; diff=18-12; p=.0001/2;  *one sided pvalue; t=abs(TINV(p,n1+n2-2)); vr = (  ((diff)/t)/ (sqrt(1/120 + 1/125)))**2; sd = sqrt(vr); run; proc print; run; Obs     n1     n2    diff       p         t          vr         sd 1     120    125      6     .00005    3.95615    140.826    11.8670 in my ballpark, 12 is close enough, or even 10 12 14 to see how sensitive the change is to the std dev. proc power; twosamplemeans test = diff dist = normal groupmeans = 12 | 12 stddev = 10 12 14 nulldiff = 1 3 sides = L alpha = 0.05 ntotal = . power = .80 ; run; Robin High UNMC From: Paul Miller To: SAS-L@LISTSERV.UGA.EDU Date: 09/24/2010 01:22 PM Subject: Sample size calculation for non-inferiority test of differences   between means Sent by: "SAS(r) Discussion" Hello Everyone, Given limited information, I would like to conduct some rough sample size calculations for a non-inferiority test of differences between means. These are the results I have from a previous study: N for Treatment = 120 N for Control = 125 Observed difference in recovery time = 12 days vs. 18 days P-value = 0.0001 I need to do a sample size calculation comparing the previous treatment to a new one. The test here will be a non-inferiority test of differences between means. Two sample size calculations need to be done. One will look at a difference of 1 day and one will look at a difference of 3 days. The code I've worked out so far for doing this is pasted below and an explanation of what I'm trying to do follows. **** Figure out what polled SD was based on abstract; **** Need this for power calculations; **** Determine t value that generates p = .0001 on N - 2 df; data _null_; format x pvalue6.4; x = (1-probt(3.9,243))*2; put x; run; **** Determine what pooled variance yields the observed t value; data _null_; x = (18-12) / sqrt(145 * (1/120 + 1/125)); put x; run; **** Take square root of pooled variance to get common SD; data _null_; x = sqrt(145); put x; run; **** Calculate sample size needed to demonstrate non-inferiority; **** Difference of 1 day; proc power; twosamplemeans test = diff groupmeans = 12 | 12 stddev = 12.041594579 nulldiff = 1 sides = L alpha = 0.05 ntotal = . power = .80 dist = normal; run; **** Difference of 3 days; proc power; twosamplemeans test = diff groupmeans = 12 | 12 stddev = 12.041594579 nulldiff = 3 sides = L alpha = 0.05 ntotal = . power = .80 dist = normal; run; So the idea is to determine what t-value would have generated p = 0.0001 on 243 (N-2) df, to determine what pooled variance would have generated that t-value by plugging values into the formula for t, and then to take the square root of that value as an estimate of the common standard deviation for my power analyses. So I guess I have 2 questions: 1. Is what I'm doing essentially correct including the actual power analyses? 2. Is there a better/less ridiculous way of doing this? Thanks, Paul ```

Back to: Top of message | Previous page | Main SAS-L page