Algorithm (PSS: Two-Proportion Test)

 

Power

One-sided power:H_0:P_1\ge P_2

Power =F(\frac{-(p_2-p_1)-z_{\alpha }\sqrt{(2p_c(1-p_c) / n) }}{\sqrt{p_2(1-p_2)/n+p_2(1-p_2)/n}})

One-sided power:H_0:P_1\le P_2

Power =1-F(\frac{-(p_2-p_1)+z_{\alpha }\sqrt{(2p_c(1-p_c) / n) }}{\sqrt{p_2(1-p_2)/n+p_2(1-p_2)/n}})

Two-sided power H_0: p_1=p_2\!

Power =1-F(\frac{-(p_2-p_1)+z_{\alpha/2 }\sqrt{(2p_c(1-p_c) / n) }}{\sqrt{p_2(1-p_2)/n+p_2(1-p_2)/n}})+F(\frac{-(p_2-p_1)-z_{\alpha /2}\sqrt{(2p_c(1-p_c) / n) }}{\sqrt{p_2(1-p_2)/n+p_2(1-p_2)/n}})

n:sample size

P1:population proportion 1

P2:population proportion 2

pc=(p1 + p2)/2\!

p1:the sample proportion 1

p2:the sample proportion 2

F:the cumulative distribution function of the standard normal distribution

sample size

Origin uses an iterative algorithm with the power equation. At each iteration,the power for a trial sample size are evaluated and iteration stops when the power evaluated reaches the values which corresponding to an integer sample size, and which is nearest to, yet greater than, the target value.