I tried to conduct power analysis by using chi-square test, and the sample size for each group is 111 with power of .8 and alpha level of .05. But I think the sample per group is still too large, I want to reduce the sample size a little bit without compromising the power, so I conducted non-inferiority and tried if I can reduce the sample size. I used the below code:
proc power;
twosamplefreq test=fm
nullproportiondiff=-0.15 -0.10
refproportion=0.45
proportiondiff=-0.18
sides = U
alpha=0.01 0.05
npergroup=.
power=0.8;
run;
However, the outcome is invalid, I am not sure what's going on here. I saw a warning
WARNING: The effect is in the opposite direction from the alternative hypothesis in 4 scenarios in the output table.
Could you help me with it? Or is there some other ways to reduce the sample size without reducing the power? Thank you!
You might find the following usage note helpful --
http://support.sas.com/kb/48616
So if you wanted an upper-sided test, you might want to specify a positive value for proportiondiff. For example --
proc power;
twosamplefreq test=fm
nullproportiondiff=-0.15 -0.10
refproportion=0.45
proportiondiff=0.18
sides = U
alpha=0.01 0.05
npergroup=.
power=0.8;
run;
If you want to have the same power but smaller sample size, then your assumed proportion difference needs to be bigger, or the margin size needs to be bigger. For example, either one of the following programs should give you a smaller sample size --
proc power;
twosamplefreq test=fm
nullproportiondiff=-0.15 -0.10
refproportion=0.45
proportiondiff=0.28
sides = U
alpha=0.01 0.05
npergroup=.
power=0.8;
run;
proc power;
twosamplefreq test=fm
nullproportiondiff=-0.25 -0.20
refproportion=0.45
proportiondiff=0.18
sides = U
alpha=0.01 0.05
npergroup=.
power=0.8;
run;
Hope this helps,
Jill
What about the original code that gave you the sample size of 111?
I would start with that and try reducing the sample size and see the resulting power.
Also, warnings are not errors. Sometimes the tell you that you may be pushing a particular set of options/parameters just a bit far. Sometimes these warnings are a reminder to double check what you set. You might find that you typed .10 when you intended .01 (for something completely made up and not related to your problem) though I did see an alpha= 0.5 one time instead of 0.05 and the question was why is the sample so small (don't think that was on this forum though)
I would take this a time to consider the signs of your diff parameters.
You might find the following usage note helpful --
http://support.sas.com/kb/48616
So if you wanted an upper-sided test, you might want to specify a positive value for proportiondiff. For example --
proc power;
twosamplefreq test=fm
nullproportiondiff=-0.15 -0.10
refproportion=0.45
proportiondiff=0.18
sides = U
alpha=0.01 0.05
npergroup=.
power=0.8;
run;
If you want to have the same power but smaller sample size, then your assumed proportion difference needs to be bigger, or the margin size needs to be bigger. For example, either one of the following programs should give you a smaller sample size --
proc power;
twosamplefreq test=fm
nullproportiondiff=-0.15 -0.10
refproportion=0.45
proportiondiff=0.28
sides = U
alpha=0.01 0.05
npergroup=.
power=0.8;
run;
proc power;
twosamplefreq test=fm
nullproportiondiff=-0.25 -0.20
refproportion=0.45
proportiondiff=0.18
sides = U
alpha=0.01 0.05
npergroup=.
power=0.8;
run;
Hope this helps,
Jill
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.