-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Inconsistent behaviour in power calculation #8774
Comments
I don't manage to make the difference go away completely, but the difference becomes smaller if
with one sided alternative and t-test, I get at a 0.025 tail
and at a 0.05 tail
I currently don't see where the remaining difference comes from. |
using the ztest power replicates your results
|
Thanks for investigating - really helpful. I think this can be closed then |
Describe the bug
I don't understand why I'm getting different results between statsmodels and manually doing it in scipy. I presume I'm doing something wrong but would love if someone would help me understand.
Code Sample, a copy-pastable example if possible
Manually calculating power with scipy
Calculating power with statsmodels
There is only a 0.4 difference but I don't understand why there is any difference at all.
Thanks in advance for your help!
Output of
import statsmodels.api as sm; sm.show_versions()
statsmodels
Installed: 0.13.5 (/home/rward/downloads/ENTER/envs/stats/lib/python3.10/site-packages/statsmodels)
Required Dependencies
cython: Not installed
numpy: 1.23.1 (/home/rward/downloads/ENTER/envs/stats/lib/python3.10/site-packages/numpy)
scipy: 1.8.1 (/home/rward/downloads/ENTER/envs/stats/lib/python3.10/site-packages/scipy)
pandas: 1.4.3 (/home/rward/downloads/ENTER/envs/stats/lib/python3.10/site-packages/pandas)
dateutil: 2.8.2 (/home/rward/downloads/ENTER/envs/stats/lib/python3.10/site-packages/dateutil)
patsy: 0.5.2 (/home/rward/downloads/ENTER/envs/stats/lib/python3.10/site-packages/patsy)
Optional Dependencies
matplotlib: 3.5.2 (/home/rward/downloads/ENTER/envs/stats/lib/python3.10/site-packages/matplotlib)
backend: module://matplotlib_inline.backend_inline
cvxopt: Not installed
joblib: 1.1.0 (/home/rward/downloads/ENTER/envs/stats/lib/python3.10/site-packages/joblib)
Developer Tools
IPython: 8.4.0 (/home/rward/downloads/ENTER/envs/stats/lib/python3.10/site-packages/IPython)
jinja2: 3.0.3 (/home/rward/downloads/ENTER/envs/stats/lib/python3.10/site-packages/jinja2)
sphinx: Not installed
pygments: 2.11.2 (/home/rward/downloads/ENTER/envs/stats/lib/python3.10/site-packages/pygments)
pytest: Not installed
virtualenv: Not installed
The text was updated successfully, but these errors were encountered: