Total noob to statsmodels (using fresh install of 0.5.0, patsy 0.1.0, pandas 0.9, python 2.7.3) here. I'm trying to follow the documentation for GLMs (http://statsmodels.sourceforge.net/devel/examples/generated/example_glm.html) to estimate some version of a binomial model and getting a cryptic error message: "keyword can't be an expression". The input is a 1239-row, 11-column pandas dataframe from which I'm specifying the model below. A normal OLS estimates correctly, but any GLM family I specify doesn't estimate. Any help would be appreciated! ThanksIn [100]:Out[100]:
192858 degree 30 downloads 948 authors 3 closeness 0.245614 node_type paper year 1994 clustering 1 name Life and death of new technology: task, utilit... betweenness 0 citations 13 publications -1 In [122]:In [120]:Out[120]:
Intercept authors year degree 192858 1 3 1994 30 192878 1 1 1994 2 2441981 1 4 2013 11 1180956 1 2 2006 12 1180955 1 1 2006 7 In [119]:Out[119]:
downloads 192858 948 192878 1483 2441981 45 1180956 1765 1180955 653 In [121]:File "<ipython-input-121-0b7ad9bf1600>", line 1 SyntaxError: keyword can't be an expression
mod1 = sm.GLM(y1,X1.family=sm.families.Binomial())
it should be
mod1 = sm.GLM(y1,X1, family=sm.families.Binomial())N.B.In [1]: def f(a, b=None): ...: pass ...: In [2]: f(a, x.y=2) File "<ipython-input-2-124d23405480>", line 1 f(a, x.y=2) SyntaxError: keyword can't be an expression