LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2010, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 24 Sep 2010 15:57:46 -0500
Reply-To:     Robin R High <rhigh@UNMC.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Robin R High <rhigh@UNMC.EDU>
Subject:      Re: Sample size calculation for non-inferiority test of
              differences between means
Comments: To: Paul Miller <pjmiller_57@YAHOO.COM>
In-Reply-To:  <377904.56577.qm@web57001.mail.re3.yahoo.com>
Content-Type: text/plain; charset="US-ASCII"

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 <pjmiller_57@YAHOO.COM> 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" <SAS-L@LISTSERV.UGA.EDU>

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