目的探究单样本率确切概率检验样本量估算非单调性的原因,通过SAS编程纠正其非单调性,并实现先设定检验效能后估算样本量的功能。方法从二项分布的离散性入手,分析检验效能与样本量非单调变化的原因,编写SAS宏程序实现计算功能。结果单样本率确切概率检验中,样本量与检验效能呈锯齿状非单调变化关系,这种现象由离散概率分布的实际检验水准常低于检验前所设定的理论检验水准所致。结论我们提出了纠正单样本率确切概率检验样本量估算的非单调性方法 ,即对于所有满足设定检验效能的样本量,找到一个不中断序列中的最小值,就是所估算的样本量。根据这一思路,本研究还解决了先设定检验效能后估算样本量的问题。
ObjectiveTo explain the reason of non-monotonicity between power and sample size using exact method and to correct the non-monotonicity with SAS macro program that realizes exact methods sample size computation with a specified power. MethodsThe reason of non-monotonicity between power and sample size was detected in terms of the discreteness of binomial distribution.The SAS macro program was explored to compute the sample size with a specified power. ResultsIn one-sample binomial proportion exact test,the power and sample size have a saw-toothed shape relationship and they are not monotonically increasing.The reason for this counter-intuitive phenomenon is that for discrete tests the actual significance level always strays below the specified significance level and varies with sample size. ConclusionWe proposed a solution to correct the non-monotonicity.The method can ensure that the power is kept above the specified value while the sample size increases.The SAS macro programmed by us is available for meeting the sample size computation with a specified power using one-sample binomial proportion exact test.