statsmodels-tutorial icon indicating copy to clipboard operation
statsmodels-tutorial copied to clipboard

TypeError in discrete_choice

Open cdeil opened this issue 12 years ago • 1 comments

mfx = affair_mod.margeff()
print pandas.Series(mfx, index=affair_mod.params.index[1:])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-15-3f999b08521d> in <module>()
----> 1 mfx = affair_mod.margeff()
      2 print pandas.Series(mfx, index=affair_mod.params.index[1:])

/Users/deil/Library/Python/2.7/lib/python/site-packages/statsmodels-0.5.0-py2.7-macosx-10.7-x86_64.egg/statsmodels/discrete/discrete_model.pyc in margeff(self, at, method, atexog, dummy, count)
   1814                                                 self.model._derivative_exog,
   1815                                                 dummy_ind, count_ind,
-> 1816                                                 method)
   1817         # don't care about at constant
   1818         self.margeff_cov = margeff_cov[ind][:, ind]

TypeError: margeff_cov_with_se() takes exactly 10 arguments (9 given)

/Users/deil/Library/Python/2.7/lib/python/site-packages/statsmodels-0.5.0-py2.7-macosx-10.7-x86_64.egg/statsmodels/discrete/discrete_model.py:1746: FutureWarning: This method is deprecated and will be removed in 0.6.0. Use get_margeff instead
  " Use get_margeff instead", FutureWarning)

cdeil avatar Aug 31 '12 09:08 cdeil

Thanks, this is a bug against statsmodels. It looks like you're running the code from github. This code has been updated since the tutorial. You can use get_margeff instead of margeff, which is now deprecated. I'll need to update this part of the tutorial.

jseabold avatar Aug 31 '12 12:08 jseabold