16

I'm running the code below with statsmodel 0.8.0 which i believe is the latest.

import statsmodels.api as sm
est = sm.Logit(y_train, x_train)
result = est.fit()
print(result.summary())

This is giving me an error saying:

AttributeError: module 'scipy.stats' has no attribute 'chisqprob'.

I dont seem to be able to find anything on stackoverflow or elsewhere to resolve this. Any help much appreciated.

A Rob4
  • 1,278
  • 3
  • 17
  • 35

3 Answers3

2

I had the same problem but this solved it. However, you first need to import stats from scipy.

stats.chisqprob = lambda chisq, df: stats.chi2.sf(chisq, df)

Hope it helps you.

Kaimenyi
  • 121
  • 1
  • 2
2

You have two options. Either use,

> result.summary2()

or you can import chisqprob.

> from scipy import stats

> stats.chisqprob = lambda chisq, df: stats.chi2.sf(chisq, df)