Skip to content
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

NormalIndPower.solve_power crashes with TypeError #3188

Closed
psarka opened this issue Sep 6, 2016 · 2 comments
Closed

NormalIndPower.solve_power crashes with TypeError #3188

psarka opened this issue Sep 6, 2016 · 2 comments

Comments

@psarka
Copy link

psarka commented Sep 6, 2016

In 0.6.1 version NormalIndPower.solve_power seems to be broken:

Running

import statsmodels.api as sm
sm.stats.NormalIndPower.solve_power(0.1)

results in an Exception:

TypeError                                 Traceback (most recent call last)
<ipython-input-4-95c51872332c> in <module>()
----> 1 sm.stats.NormalIndPower.solve_power(0.1)

/usr/local/lib/python3.5/dist-packages/statsmodels/stats/power.py in solve_power(self, effect_size, nobs1, alpha, power, ratio, alternative)
    712 
    713         '''
--> 714         return super(NormalIndPower, self).solve_power(effect_size=effect_size,
    715                                                       nobs1=nobs1,
    716                                                       alpha=alpha,

TypeError: super(type, obj): obj must be an instance or subtype of type`
@josef-pkt
Copy link
Member

The TypeError sounds strange, (*)

AFAIR, you have to specify all but one of the arguments, the one that is not specified, i.e. the one that is None, will be solved for.

(*) I need to check this (since I'm not sure I remember correctly what's required), but the type error might indicate that NormalIndPower needs to be instantiated
i.e. with parenthesis NormalIndPower() creates an instance

sm.stats.NormalIndPower().solve_power(...)

@psarka
Copy link
Author

psarka commented Sep 6, 2016

You are right, adding parenthesis solves the issue.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants