stats.proportion.proportion_effectsize()

statsmodels.stats.proportion.proportion_effectsize

statsmodels.stats.proportion.proportion_effectsize(prop1, prop2, method='normal') [source]

effect size for a test comparing two proportions

for use in power function

Parameters:

prop1, prop2: float or array_like

Returns:

es : float or ndarray

effect size for (transformed) prop1 - prop2

Notes

only method=’normal’ is implemented to match pwr.p2.test see http://www.statmethods.net/stats/power.html

Effect size for normal is defined as

2 * (arcsin(sqrt(prop1)) - arcsin(sqrt(prop2)))

I think other conversions to normality can be used, but I need to check.

Examples

>>> import statsmodels.api as sm
>>> sm.stats.proportion_effectsize(0.5, 0.4)
0.20135792079033088
>>> sm.stats.proportion_effectsize([0.3, 0.4, 0.5], 0.4)
array([-0.21015893,  0.        ,  0.20135792])

© 2009–2012 Statsmodels Developers
© 2006–2008 Scipy Developers
© 2006 Jonathan E. Taylor
Licensed under the 3-clause BSD License.
http://www.statsmodels.org/stable/generated/statsmodels.stats.proportion.proportion_effectsize.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部