BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
newtriks
Obsidian | Level 7

Running a power analysis on 9.4 to determine sample size. Comparing a new testing method to a "gold standard" test which is correct 100% of the time on a binary, yes/no outcome. Will accept the new method as "noninferior" if it matches the gold standard 90% of the time. One-sided Alpha = .05 with 90% power. 

I'm having difficulty with the coding. I went with what I thought the SAS manual recommended for the above parameters, but it won't give me an N ("ERROR: NTOTAL is not available for TEST=EXACT"). 

 

PROC POWER;

ONESAMPLEFREQ 

TEST = EXACT

METHOD=EXACT

NULLPROPORTION=.9

PROPORTION = .8 TO .95 BY .01

SIDES = U

POWER = .9

ALPHA = .05

NTOTAL = .;

PLOT X = EFFECT'

RUN;

Any help would be appreciated. Thanks.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

Since you are doing one-way  noninferiority test,

You should firstly specify a decent MARGIN value in PROC POWER,

And adjust parameter proportion= ,margin= ,ntotal= to get rid of these WARNING message.

 

proc power;
onesamplefreq test=exact
sides = U
proportion = .82 TO .9 BY .01
nullproportion = 0.9
margin = -0.1
ALPHA = .05
ntotal =  100 to 1000 by 100
power = .;
run;

View solution in original post

6 REPLIES 6
newtriks
Obsidian | Level 7
There's a semicolon after PLOT X = EFFECT; - that's not what's causing the issues.
ballardw
Super User

When SAS tells you it won't do something, such a NTOTALS for TEST=Exact, then it won't.

 

But sometimes you can approach the problem from the other side. Provide a range of values for NTOTALS and see what the Power is. Refine the lists for those cases of interest. As an example of a starting point.

PROC POWER;
ONESAMPLEFREQ 
TEST = EXACT
METHOD=EXACT
NULLPROPORTION=.9
PROPORTION = .8 TO .95 BY .01
SIDES = U
POWER = .
ALPHA = .05
NTOTAL =  100 to 1000 by 100;
RUN;

You can see that for proportions under .90 that 1000 is too small.

You also get notes

WARNING: The effect is in the opposite direction from the alternative hypothesis in one of the
         scenarios in the output table.

actually more than one of the scenarios. Which means you may to reconsider if all of your combinations of NULLPROPORTION and PROPORTION actually make sense.

 

Play with values of NTOTALS and see how close you get to the power of .9 you can get. And which scenarios NEVER get there.

 

newtriks
Obsidian | Level 7

Thanks. Tried to accept as solution.

Ksharp
Super User

Since you are doing one-way  noninferiority test,

You should firstly specify a decent MARGIN value in PROC POWER,

And adjust parameter proportion= ,margin= ,ntotal= to get rid of these WARNING message.

 

proc power;
onesamplefreq test=exact
sides = U
proportion = .82 TO .9 BY .01
nullproportion = 0.9
margin = -0.1
ALPHA = .05
ntotal =  100 to 1000 by 100
power = .;
run;
newtriks
Obsidian | Level 7

Thanks. I tried to accept this as a solution.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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
  • 6 replies
  • 1483 views
  • 4 likes
  • 3 in conversation