Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Some of the basic power calculations are now available in statsmodels</p> <p><a href="http://statsmodels.sourceforge.net/devel/stats.html#power-and-sample-size-calculations" rel="noreferrer">http://statsmodels.sourceforge.net/devel/stats.html#power-and-sample-size-calculations</a> <a href="http://jpktd.blogspot.ca/2013/03/statistical-power-in-statsmodels.html" rel="noreferrer">http://jpktd.blogspot.ca/2013/03/statistical-power-in-statsmodels.html</a></p> <p>The blog article does not yet take the latest changes to the statsmodels code into account. Also, I haven't decided yet how many wrapper functions to provide, since many power calculations just reduce to the basic distribution.</p> <pre><code>&gt;&gt;&gt; import statsmodels.stats.api as sms &gt;&gt;&gt; es = sms.proportion_effectsize(0.5, 0.75) &gt;&gt;&gt; sms.NormalIndPower().solve_power(es, power=0.9, alpha=0.05, ratio=1) 76.652940372066908 </code></pre> <p>In R stats</p> <pre><code>&gt; power.prop.test(p1 = .50, p2 = .75, power = .90) Two-sample comparison of proportions power calculation n = 76.7069301141077 p1 = 0.5 p2 = 0.75 sig.level = 0.05 power = 0.9 alternative = two.sided NOTE: n is number in *each* group </code></pre> <p>using R's <code>pwr</code> package</p> <pre><code>&gt; library(pwr) &gt; h&lt;-ES.h(0.5,0.75) &gt; pwr.2p.test(h=h, power=0.9, sig.level=0.05) Difference of proportion power calculation for binomial distribution (arcsine transformation) h = 0.5235987755982985 n = 76.6529406106181 sig.level = 0.05 power = 0.9 alternative = two.sided NOTE: same sample sizes </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload