internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: statsmodels/statsmodels

Issue:
BUG: arimax forecast should special case k_ar == 0 
See this post on SO

https://stackoverflow.com/questions/25044165/python-arima-exogenous-variable-out-of-sample



Discussion:

Resolving patch:
diff --git a/statsmodels/tsa/arima_model.py b/statsmodels/tsa/arima_model.py
--- a/statsmodels/tsa/arima_model.py
+++ b/statsmodels/tsa/arima_model.py
@@ -656,7 +656,7 @@ def predict(self, params, start=None, end=None, exog=None, dynamic=False):
             if self.k_exog == 1 and exog.ndim == 1:
                 exog = exog[:, None]
                 # we need the last k_ar exog for the lag-polynomial
-            if self.k_exog > 0:
+            if self.k_exog > 0 and k_ar > 0:
                 # need the last k_ar exog for the lag-polynomial
                 exog = np.vstack((self.exog[-k_ar:, self.k_trend:], exog))
 


Test patch:
Repository: statsmodels/statsmodels

Issue:
BUG plot for tukeyhsd, MultipleComparison
`fig = res2.plot_simultaneous()`
in test example with string/bytes labels

the labels on the left for y-axis are shifted relative to the plot elements in the graph.

eventually we have to figure out how to test plots to avoid refactoring bugs.



Discussion:
here's the gist
http://nbviewer.ipython.org/gist/josef-pkt/10000517

Thomas's solution on the mailing list

add line
`ax1.set_yticks(arange(-1, len(means)+1))`


Resolving patch:
diff --git a/statsmodels/sandbox/stats/multicomp.py b/statsmodels/sandbox/stats/multicomp.py
--- a/statsmodels/sandbox/stats/multicomp.py
+++ b/statsmodels/sandbox/stats/multicomp.py
@@ -760,6 +760,7 @@ def plot_simultaneous(self, comparison_name=None, ax=None, figsize=(10,6),
         ax1.set_ylim([-1, self._multicomp.ngroups])
         ax1.set_xlim([np.min(minrange) - r / 10., np.max(maxrange) + r / 10.])
         ax1.set_yticklabels(np.insert(self.groupsunique.astype(str), 0, ''))
+        ax1.set_yticks(np.arange(-1, len(means)+1))
         ax1.set_xlabel(xlabel if xlabel is not None else '')
         ax1.set_ylabel(ylabel if ylabel is not None else '')
         return fig


Test patch:
Repository: statsmodels/statsmodels

Issue:
TST test_gmm outdated pandas, compat
running the test suite with pandas master, I get this warning

```
e:\josef\testing\tox\py27e\lib\site-packages\statsmodels-0.6.0-py2.7-win32.egg\statsmodels\sandbox\regression\tests\test_gmm.py:33: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame

See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  griliches76_data['D_%i' %yr][i] = 1
```



Discussion:
I get another one in anova. I guess introduced in one of my recent changes

```
e:\josef\testing\tox\py27e\lib\site-packages\statsmodels-0.6.0-py2.7-win32.egg\statsmodels\stats\anova.py:356: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  table.ix[1:]["df_diff"] = -np.diff(table["df_resid"].values)
```


Resolving patch:
diff --git a/statsmodels/stats/anova.py b/statsmodels/stats/anova.py
--- a/statsmodels/stats/anova.py
+++ b/statsmodels/stats/anova.py
@@ -128,9 +128,9 @@ def anova1_lm_single(model, endog, exog, nobs, design_info, table, n_rows, test,
     table.index = Index(index + ['Residual'])
     table.ix[index, ['df', 'sum_sq']] = np.c_[arr[~idx].sum(1), sum_sq]
     if test == 'F':
-        table[:n_rows][test] = ((table['sum_sq']/table['df'])/
+        table.ix[:n_rows, test] = ((table['sum_sq']/table['df'])/
                                 (model.ssr/model.df_resid))
-        table[:n_rows][pr_test] = stats.f.sf(table["F"], table["df"],
+        table.ix[:n_rows, pr_test] = stats.f.sf(table["F"], table["df"],
                                 model.df_resid)
 
     # fill in residual
@@ -353,7 +353,7 @@ def anova_lm(*args, **kwargs):
 
     table["ssr"] = lmap(getattr, args, ["ssr"]*n_models)
     table["df_resid"] = lmap(getattr, args, ["df_resid"]*n_models)
-    table.ix[1:]["df_diff"] = -np.diff(table["df_resid"].values)
+    table.ix[1:, "df_diff"] = -np.diff(table["df_resid"].values)
     table["ss_diff"] = -table["ssr"].diff()
     if test == "F":
         table["F"] = table["ss_diff"] / table["df_diff"] / scale


Test patch:
diff --git a/statsmodels/sandbox/regression/tests/test_gmm.py b/statsmodels/sandbox/regression/tests/test_gmm.py
--- a/statsmodels/sandbox/regression/tests/test_gmm.py
+++ b/statsmodels/sandbox/regression/tests/test_gmm.py
@@ -29,8 +29,8 @@ def get_griliches76_data():
     for yr in years:
         griliches76_data['D_%i' %yr] = np.zeros(N)
         for i in range(N):
-            if griliches76_data['year'][i] == yr:
-                griliches76_data['D_%i' %yr][i] = 1
+            if griliches76_data.ix[i, 'year'] == yr:
+                griliches76_data.ix[i, 'D_%i' %yr] = 1
             else:
                 pass
Repository: statsmodels/statsmodels

Issue:
BUG: pvalues for cluster robust, with use_t don't use df_resid_inference
I forgot to change this in ffee547e635723ae1b4baf2b18294f030542eb13  as part of PR #1867

no unittests for the `use_t` option in cluster robust standard errors
(I think I only test that the attribute is set, but not that all results are verified in this case.
there should be a small sample test case, but maybe it's not yet used when cov_type is chosen in the fit method.)

found while looking at a cluster robust GLM-Poisson with use_t

(conf_int and hypothesis tests are correctly changed)



Discussion:

Resolving patch:
diff --git a/statsmodels/base/model.py b/statsmodels/base/model.py
--- a/statsmodels/base/model.py
+++ b/statsmodels/base/model.py
@@ -885,7 +885,8 @@ def tvalues(self):
     @cache_readonly
     def pvalues(self):
         if self.use_t:
-            return stats.t.sf(np.abs(self.tvalues), self.df_resid)*2
+            df_resid = getattr(self, 'df_resid_inference', self.df_resid)
+            return stats.t.sf(np.abs(self.tvalues), df_resid)*2
         else:
             return stats.norm.sf(np.abs(self.tvalues))*2
 


Test patch:
diff --git a/statsmodels/regression/tests/test_robustcov.py b/statsmodels/regression/tests/test_robustcov.py
--- a/statsmodels/regression/tests/test_robustcov.py
+++ b/statsmodels/regression/tests/test_robustcov.py
@@ -405,6 +405,16 @@ def setup(self):
         self.rtolh = 1e-10
 
 
+    def test_basic_inference(self):
+        res1 = self.res1
+        res2 = self.res2
+        rtol = 1e-7
+        assert_allclose(res1.params, res2.params, rtol=1e-8)
+        assert_allclose(res1.bse, res2.bse, rtol=rtol)
+        assert_allclose(res1.pvalues, res2.pvalues, rtol=rtol, atol=1e-20)
+        ci = res2.params_table[:, 4:6]
+        assert_allclose(res1.conf_int(), ci, rtol=5e-7, atol=1e-20)
+
 
 class TestOLSRobustCluster2Large(CheckOLSRobustCluster, CheckOLSRobustNewMixin):
     # compare with `reg cluster`
Repository: statsmodels/statsmodels

Issue:
inconvenient: logit when endog is (1,2) instead of (0,1)
This breaks with a Singular Matrix problem in the Hessian calculation.
It took me two hours of figuring out the singular matrix issue, before I thought of checking endog

I think we should add a basic check for this.

I haven't looked at the details yet.

related: I was looking at using Logit for continuous variables in [0,1] interval, and it seemed to work.



Discussion:
http://stackoverflow.com/questions/20703733/logit-regression-and-singular-matrix-error-in-python

We should raise an error if there are no zero values  `(endog==0).sum() == 0`.


Resolving patch:
diff --git a/statsmodels/discrete/discrete_model.py b/statsmodels/discrete/discrete_model.py
--- a/statsmodels/discrete/discrete_model.py
+++ b/statsmodels/discrete/discrete_model.py
@@ -360,6 +360,14 @@ def _derivative_exog(self, params, exog=None, dummy_idx=None,
         raise NotImplementedError
 
 class BinaryModel(DiscreteModel):
+
+    def __init__(self, endog, exog, **kwargs):
+        super(BinaryModel, self).__init__(endog, exog, **kwargs)
+        if (self.__class__.__name__ != 'MNLogit' and
+            not np.all(np.unique(self.endog) == [0, 1])):
+            raise ValueError("endog must contain 0s and 1s only.")
+
+
     def predict(self, params, exog=None, linear=False):
         """
         Predict response variable of a model given exogenous variables.


Test patch:
diff --git a/statsmodels/discrete/tests/test_discrete.py b/statsmodels/discrete/tests/test_discrete.py
--- a/statsmodels/discrete/tests/test_discrete.py
+++ b/statsmodels/discrete/tests/test_discrete.py
@@ -1349,6 +1349,11 @@ def test_isdummy():
     assert_equal(count_ind, [4, 6])
 
 
+def test_non_binary():
+    y = [1, 2, 1, 2, 1, 2]
+    X = np.random.randn(6, 2)
+    np.testing.assert_raises(ValueError, Logit, y, X)
+
 if __name__ == "__main__":
     import nose
     nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb'],
Repository: statsmodels/statsmodels

Issue:
MixedLM bug
Somewhere `exog_re` gets changed from an array to a list.

```
[25]: paste
import statsmodels.api as sm
import statsmodels.formula.api as smf
data = sm.datasets.get_rdataset("dietox", "geepack", cache=True).data

md = smf.mixedlm("Weight ~ Time", data, groups=data["Pig"])
mdf = md.fit()

print mdf.profile_re(0)
print mdf.profile_re(0)

## -- End pasted text --
[[   29.94144197 -2406.61496645]
 [   32.03455083 -2405.85095315]
 [   34.12665634 -2405.33098125]
 [   36.21794445 -2405.00312497]
 [   38.30855783 -2404.82800869]
 [   40.39860778 -2404.77533787]
 [   42.48818238 -2404.82150608]
 [   44.57735228 -2404.94790994]
 [   46.66617478 -2405.13974143]
 [   48.75469685 -2405.38510771]
 [   50.84295737 -2405.6743806 ]]
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-25-cb0be708ca17> in <module>()
      7 
      8 print mdf.profile_re(0)
----> 9 print mdf.profile_re(0)

/home/skipper/statsmodels/statsmodels-skipper/statsmodels/regression/mixed_linear_model.py in profile_re(self, re_ix, num_low, dist_low, num_high, dist_high)
   1960         model = self.model
   1961         k_fe = model.exog.shape[1]
-> 1962         k_re = model.exog_re.shape[1]
   1963 
   1964         # Need to permute the columns of the random effects design

AttributeError: 'list' object has no attribute 'shape'
```



Discussion:
cc @kshedden


Resolving patch:
diff --git a/statsmodels/regression/mixed_linear_model.py b/statsmodels/regression/mixed_linear_model.py
--- a/statsmodels/regression/mixed_linear_model.py
+++ b/statsmodels/regression/mixed_linear_model.py
@@ -2010,6 +2010,6 @@ def profile_re(self, re_ix, num_low=5, dist_low=1., num_high=5,
         likev = np.asarray(likev)
 
         # Restore the original exog
-        model.exog_re = exog_re_li_save
+        model.exog_re_li = exog_re_li_save
 
         return likev


Test patch:
Repository: statsmodels/statsmodels

Issue:
do not cythonize when cleaning up
```
$> python setup.py clean
Cythonizing sources
Processing statsmodels/tsa/kalmanf/kalman_loglike.pyx
Processing statsmodels/nonparametric/_smoothers_lowess.pyx
Processing statsmodels/nonparametric/linbin.pyx
running clean
```



Discussion:
line 419:

```
    if not os.path.exists(os.path.join(cwd, 'PKG-INFO')):
        # Generate Cython sources, unless building from source release
        generate_cython()
```

I think the `if` here needs more conditions. for example the same as on line 385

```
if not (len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or
            sys.argv[1] in ('--help-commands', 'egg_info', '--version',
                            'clean'))):
```

change in 0.6 or in 0.7 ?


Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -20,6 +20,10 @@
 # certain easy_install versions
 os.environ["MPLCONFIGDIR"] = "."
 
+no_frills = (len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or
+                                     sys.argv[1] in ('--help-commands',
+                                                     'egg_info', '--version',
+                                                     'clean')))
 
 # try bootstrapping setuptools if it doesn't exist
 try:
@@ -385,10 +389,9 @@ def get_data_files():
         # 3.3 needs numpy 1.7+
         min_versions.update({"numpy" : "1.7.0b2"})
 
-    if not (len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or
-            sys.argv[1] in ('--help-commands', 'egg_info', '--version',
-                            'clean'))):
-        setup_requires, install_requires = check_dependency_versions(min_versions)
+    if not no_frills:
+        (setup_requires,
+         install_requires) = check_dependency_versions(min_versions)
         if _have_setuptools:
             setuptools_kwargs['setup_requires'] = setup_requires
             setuptools_kwargs['install_requires'] = install_requires
@@ -423,7 +426,7 @@ def get_data_files():
     # 'statsmodels/statsmodelsdoc.chm')
 
     cwd = os.path.abspath(os.path.dirname(__file__))
-    if not os.path.exists(os.path.join(cwd, 'PKG-INFO')):
+    if not os.path.exists(os.path.join(cwd, 'PKG-INFO')) and not no_frills:
         # Generate Cython sources, unless building from source release
         generate_cython()
 


Test patch:
Repository: statsmodels/statsmodels

Issue:
In tukey_hsd.plot_simultaneous - "ones" not defined.
I believe the `ones` should be `np.ones`.

```

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-30-234737c8d0af> in <module>()
----> 1 tuk.plot_simultaneous()

/home/thauck/.virtualenvs/zues/local/lib/python2.7/site-packages/statsmodels/sandbox/stats/multicomp.pyc in plot_simultaneous(self, comparison_name, ax, figsize, xlabel, ylabel)
    712             fig.set_size_inches(figsize)
    713         if getattr(self, 'halfwidths', None) is None:
--> 714             self._simultaneous_ci()
    715         means = self._multicomp.groupstats.groupmean
    716 

/home/thauck/.virtualenvs/zues/local/lib/python2.7/site-packages/statsmodels/sandbox/stats/multicomp.pyc in _simultaneous_ci(self)
    640         self.halfwidths = simultaneous_ci(self.q_crit, self.variance,
    641                             self._multicomp.groupstats.groupnobs,
--> 642                             self._multicomp.pairindices)
    643 
    644     def plot_simultaneous(self, comparison_name=None, ax=None, figsize=(10,6),

/home/thauck/.virtualenvs/zues/local/lib/python2.7/site-packages/statsmodels/sandbox/stats/multicomp.pyc in simultaneous_ci(q_crit, var, groupnobs, pairindices)
   1321         w = ((ng-1.) * sum2 - sum1) / ((ng - 1.) * (ng - 2.))
   1322     else:
-> 1323         w = sum1 * ones(2, 1) / 2.
   1324 
   1325     return (q_crit / np.sqrt(2))*w

NameError: global name 'ones' is not defined
```

```
>>> sm.version.full_version
'0.5.0'
```



Discussion:
Thanks, it's still there (in my checkout of some branch of recent master)
eclipse/pydev shows another red for undefined variables for the triu option in distance_st_range (which looks like a rewritten helper function that's not used yet).

I don't know if there was much checking for the case when we only have two samples and a single pair in the comparison.


Resolving patch:
diff --git a/statsmodels/sandbox/stats/multicomp.py b/statsmodels/sandbox/stats/multicomp.py
--- a/statsmodels/sandbox/stats/multicomp.py
+++ b/statsmodels/sandbox/stats/multicomp.py
@@ -1346,7 +1346,7 @@ def simultaneous_ci(q_crit, var, groupnobs, pairindices=None):
     if (ng > 2):
         w = ((ng-1.) * sum2 - sum1) / ((ng - 1.) * (ng - 2.))
     else:
-        w = sum1 * ones(2, 1) / 2.
+        w = sum1 * np.ones(2, 1) / 2.
 
     return (q_crit / np.sqrt(2))*w
 


Test patch:
Repository: statsmodels/statsmodels

Issue:
MixedLM profile likelihood issue
The default example in the MixedLM notebook example does not work for the profile likelihood. It will be merged in #2097 mainly because the steps are instructive I guess. I don't know if it's just a hard problem, there's a bug, or if there's anything that can be done in the algorithm to restrict the covariance to be positive-(semi?)definite or to fix the likelihood calculation to account for this.

I also don't know why it works in [this notebook](http://nbviewer.ipython.org/urls/umich.box.com/shared/static/mmgp8ztqnt1kvhmw1kd9.ipynb) other than the usual version/system differences.



Discussion:
Thanks for catching this.  I think it is fixed now.


Resolving patch:
diff --git a/statsmodels/regression/mixed_linear_model.py b/statsmodels/regression/mixed_linear_model.py
--- a/statsmodels/regression/mixed_linear_model.py
+++ b/statsmodels/regression/mixed_linear_model.py
@@ -2091,7 +2091,7 @@ def profile_re(self, re_ix, num_low=5, dist_low=1., num_high=5,
 
             # Shrink the covariance parameters until a PSD covariance
             # matrix is obtained.
-            dg = np.diag(cov_re)
+            dg = np.diag(cov_re).copy()
             success = False
             for ks in range(50):
                 try:


Test patch:
Repository: statsmodels/statsmodels

Issue:
webuse is not Py3 compatible
Needs StringIO -> BytesIO AFAICT.



Discussion:
While fixing this, we should switch to using `pandas.read_stata` which works on newer stata files. We fail to read the v 13 .dta examples.


Resolving patch:
diff --git a/statsmodels/datasets/utils.py b/statsmodels/datasets/utils.py
--- a/statsmodels/datasets/utils.py
+++ b/statsmodels/datasets/utils.py
@@ -1,5 +1,5 @@
 from statsmodels.compat.python import (range, StringIO, urlopen, HTTPError,
-                                       lrange, cPickle, urljoin)
+                                       lrange, cPickle, urljoin, BytesIO)
 import sys
 import shutil
 from os import environ
@@ -45,7 +45,7 @@ def webuse(data, baseurl='http://www.stata-press.com/data/r11/', as_df=True):
 
     url = urljoin(baseurl, data+'.dta')
     dta = urlopen(url)
-    dta = StringIO(dta.read())  # make it truly file-like
+    dta = BytesIO(dta.read())  # make it truly file-like
     if as_df:  # could make this faster if we don't process dta twice?
         return DataFrame.from_records(genfromdta(dta))
     else:


Test patch:
Repository: statsmodels/statsmodels

Issue:
mosaic plot does not fail gracefully
I guess sometimes the index argument is not optional. If this is the case, then there should be a type check and a good error raised.

https://stackoverflow.com/questions/27225636/how-to-create-mosaic-plot-from-pandas-dataframe-with-statsmodels-library



Discussion:

Resolving patch:
diff --git a/statsmodels/graphics/mosaicplot.py b/statsmodels/graphics/mosaicplot.py
--- a/statsmodels/graphics/mosaicplot.py
+++ b/statsmodels/graphics/mosaicplot.py
@@ -16,6 +16,7 @@
 
 from numpy import iterable, r_, cumsum, array
 from statsmodels.graphics import utils
+from pandas import DataFrame
 
 __all__ = ["mosaic"]
 
@@ -602,6 +603,10 @@ def mosaic(data, index=None, ax=None, horizontal=True, gap=0.005,
     >>> mosaic(data, ['pet', 'gender'])
     >>> pylab.show()
     """
+    if isinstance(data, DataFrame) and index is None:
+        raise ValueError("You must pass an index if data is a DataFrame."
+                         " See examples.")
+
     from pylab import Rectangle
     fig, ax = utils.create_mpl_ax(ax)
     # normalize the data to a dict with tuple of strings as keys
@@ -643,4 +648,4 @@ def mosaic(data, index=None, ax=None, horizontal=True, gap=0.005,
         ax.set_yticks([])
         ax.set_yticklabels([])
     ax.set_title(title)
-    return fig, rects
\ No newline at end of file
+    return fig, rects


Test patch:
diff --git a/statsmodels/graphics/tests/test_mosaicplot.py b/statsmodels/graphics/tests/test_mosaicplot.py
--- a/statsmodels/graphics/tests/test_mosaicplot.py
+++ b/statsmodels/graphics/tests/test_mosaicplot.py
@@ -399,5 +399,16 @@ def test_gap_split():
     conf_h = dict(proportion=[1, 2], gap=1.0, horizontal=True)
     eq(_split_rect(*pure_square, **conf_h), h_2split)
 
+
+def test_default_arg_index():
+    # 2116
+    import pandas as pd
+    df = pd.DataFrame({'size' : ['small', 'large', 'large', 'small', 'large',
+                                 'small'],
+                       'length' : ['long', 'short', 'short', 'long', 'long',
+                                   'short']})
+    assert_raises(ValueError, mosaic, data=df, title='foobar')
+
+
 if __name__ == '__main__':
     run_module_suite()
Repository: statsmodels/statsmodels

Issue:
BUG: logged exposure is attached to GLM
If we re-create the model from _init keys that includes exposure, exposure will be logged twice.



Discussion:
I worked around this in discrete Poisson and NegativeBinomial.
There is a method that gets the actual values and back transforms `exposure`.
(I need to check the details for where I used this.)

(refactoring I think the attached exposure should be the original.)


Resolving patch:
diff --git a/statsmodels/genmod/generalized_linear_model.py b/statsmodels/genmod/generalized_linear_model.py
--- a/statsmodels/genmod/generalized_linear_model.py
+++ b/statsmodels/genmod/generalized_linear_model.py
@@ -255,6 +255,16 @@ def _check_inputs(self, family, offset, exposure, endog):
             if offset.shape[0] != endog.shape[0]:
                 raise ValueError("offset is not the same length as endog")
 
+
+    def _get_init_kwds(self):
+        # this is a temporary fixup because exposure has been transformed
+        # see #1609, copied from discrete_model.CountModel
+        kwds = super(GLM, self)._get_init_kwds()
+        if 'exposure' in kwds and kwds['exposure'] is not None:
+            kwds['exposure'] = np.exp(kwds['exposure'])
+        return kwds
+
+
     def loglike_mu(self, mu, scale=1.):
         """
         Evaluate the log-likelihood for a generalized linear model.


Test patch:
diff --git a/statsmodels/genmod/tests/test_glm.py b/statsmodels/genmod/tests/test_glm.py
--- a/statsmodels/genmod/tests/test_glm.py
+++ b/statsmodels/genmod/tests/test_glm.py
@@ -628,6 +628,16 @@ def test_offset_exposure(self):
                    offset=offset2).fit()
         assert_almost_equal(mod1.params, mod2.params)
 
+        # test recreating model
+        mod1_ = mod1.model
+        kwds = mod1_._get_init_kwds()
+        assert_allclose(kwds['exposure'], exposure, rtol=1e-14)
+        assert_allclose(kwds['offset'], mod1_.offset, rtol=1e-14)
+        mod3 = mod1_.__class__(mod1_.endog, mod1_.exog, **kwds)
+        assert_allclose(mod3.exposure, mod1_.exposure, rtol=1e-14)
+        assert_allclose(mod3.offset, mod1_.offset, rtol=1e-14)
+
+
     def test_predict(self):
         np.random.seed(382304)
         endog = np.random.randint(0, 10, 100)
@@ -785,6 +795,7 @@ def test_formula_missing_exposure():
     assert_raises(ValueError, GLM, df.Foo, df[['constant', 'Bar']],
                   exposure=exposure, family=family)
 
+
 def test_plots():
 
     np.random.seed(378)