Search code examples
python-3.xstatsmodels

probit, statsmodels : AttributeError: module 'statsmodels' has no attribute 'discrete'


I have already check this post and uninstall and install again but I have still same problem.

import statsmodels

results = statsmodels.discrete.discrete_model.Probit(y, x)
print(results.summary())

and I get

    result_3 = statsmodels.discrete.discrete_model.Probit (y, x)
AttributeError: module 'statsmodels' has no attribute 'discrete'

Solution

  • Submodules are not automatically imported.

    For example, you need to import discrete_model before you have it available

    statsmodels.discrete.discrete_model

    or use the api interface

    See http://www.statsmodels.org/dev/api-structure.html for background and motivation for this.