internlm/SWE-Fixer-Train-110K huggingface dataset:
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:
diff --git a/statsmodels/datasets/tests/test_utils.py b/statsmodels/datasets/tests/test_utils.py
--- a/statsmodels/datasets/tests/test_utils.py
+++ b/statsmodels/datasets/tests/test_utils.py
@@ -1,7 +1,7 @@
 import os
 import sys
-from statsmodels.datasets import get_rdataset
-from numpy.testing import assert_
+from statsmodels.datasets import get_rdataset, webuse
+from numpy.testing import assert_, assert_array_equal
 
 cur_dir = os.path.dirname(os.path.abspath(__file__))
 
@@ -17,3 +17,22 @@ def test_get_rdataset():
     else:
         duncan = get_rdataset("Duncan", "car", cache=cur_dir)
         assert_(duncan.from_cache)
+
+
+def test_webuse():
+    # test copied and adjusted from iolib/tests/test_foreign
+    from statsmodels.iolib.tests.results.macrodata import macrodata_result as res2
+    base_gh = "http://github.com/statsmodels/statsmodels/raw/master/statsmodels/datasets/macrodata/"
+    res1 = webuse('macrodata', baseurl=base_gh, as_df=False)
+    assert_array_equal(res1 == res2, True)
+
+
+def test_webuse_pandas():
+    # test copied and adjusted from iolib/tests/test_foreign
+    from pandas.util.testing import assert_frame_equal
+    from statsmodels.datasets import macrodata
+    dta = macrodata.load_pandas().data
+    base_gh = "http://github.com/statsmodels/statsmodels/raw/master/statsmodels/datasets/macrodata/"
+    res1 = webuse('macrodata', baseurl=base_gh)
+    res1 = res1.astype(float)
+    assert_frame_equal(res1, dta)
Repository: statsmodels/statsmodels

Issue:
cov_ratio in outliers_influence returns array of zeros
params = np.zeros_like(exog)
mse_resid = np.zeros_like(endog)
det_cov_params = np.zeros_like(endog)

dtype of det_cov_params is np.int, but values from det_cov_params can be all less than 1.  Currently it is simply setting the entire array to zeros for these cases.  simple fix would be to set dtype=np.float so the values are not lost.  this is part of _res_looo

Compare R output to python,

![rcovratio](https://cloud.githubusercontent.com/assets/8975114/5509443/b3dbb3a4-877d-11e4-97b9-c7a9ef194e65.png)

![pythonrcov](https://cloud.githubusercontent.com/assets/8975114/5509460/ef4eb1fc-877d-11e4-8cf4-f7c2c605f313.png)



Discussion:

Resolving patch:
diff --git a/statsmodels/stats/outliers_influence.py b/statsmodels/stats/outliers_influence.py
--- a/statsmodels/stats/outliers_influence.py
+++ b/statsmodels/stats/outliers_influence.py
@@ -545,9 +545,9 @@ def _res_looo(self):
         endog = self.endog
         exog = self.exog
 
-        params = np.zeros_like(exog)
-        mse_resid = np.zeros_like(endog)
-        det_cov_params = np.zeros_like(endog)
+        params = np.zeros(exog.shape, dtype=np.float)
+        mse_resid = np.zeros(endog.shape, dtype=np.float)
+        det_cov_params = np.zeros(endog.shape, dtype=np.float)
 
         cv_iter = LeaveOneOut(self.nobs)
         for inidx, outidx in cv_iter:


Test patch:
diff --git a/statsmodels/stats/tests/test_diagnostic.py b/statsmodels/stats/tests/test_diagnostic.py
--- a/statsmodels/stats/tests/test_diagnostic.py
+++ b/statsmodels/stats/tests/test_diagnostic.py
@@ -14,7 +14,7 @@
 import numpy as np
 
 from numpy.testing import (assert_, assert_almost_equal, assert_equal,
-                           assert_approx_equal)
+                           assert_approx_equal, assert_allclose)
 from nose import SkipTest
 
 from statsmodels.regression.linear_model import OLS, GLSAR
@@ -761,6 +761,27 @@ def test_influence_wrapped():
     assert_almost_equal(infl.dfbetas, infl_r2[:,:3], decimal=13)
     assert_almost_equal(infl.cov_ratio, infl_r2[:,4], decimal=14)
 
+
+def test_influence_dtype():
+    # see #2148  bug when endog is integer
+    y = np.ones(20)
+    np.random.seed(123)
+    x = np.random.randn(20, 3)
+    res1 = OLS(y, x).fit()
+
+    res2 = OLS(y*1., x).fit()
+    cr1 = res1.get_influence().cov_ratio
+    cr2 = res2.get_influence().cov_ratio
+    assert_allclose(cr1, cr2, rtol=1e-14)
+    # regression test for values
+    cr3 = np.array(
+      [ 1.22239215,  1.31551021,  1.52671069,  1.05003921,  0.89099323,
+        1.57405066,  1.03230092,  0.95844196,  1.15531836,  1.21963623,
+        0.87699564,  1.16707748,  1.10481391,  0.98839447,  1.08999334,
+        1.35680102,  1.46227715,  1.45966708,  1.13659521,  1.22799038])
+    assert_almost_equal(cr1, cr3, decimal=8)
+
+
 def test_outlier_test():
     # results from R with NA -> 1. Just testing interface here because
     # outlier_test is just a wrapper
Repository: statsmodels/statsmodels

Issue:
pandas compatibility warning
https://travis-ci.org/statsmodels/statsmodels/jobs/49557248

pandas 0.15.2
numpy 1.9.1

```
/home/travis/miniconda/envs/statsmodels-test/lib/python2.7/site-packages/statsmodels-0.7.0-py2.7-linux-x86_64.egg/statsmodels/genmod/tests/test_gee.py:1423: 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
  df['constant'] = 1
```

it doesn't show where this is used

```
/home/travis/miniconda/envs/statsmodels-test/lib/python2.7/site-packages/pandas/core/categorical.py:414: FutureWarning: 'labels' is deprecated. Use 'codes' instead
  warnings.warn("'labels' is deprecated. Use 'codes' instead", FutureWarning)
```

appveyor is running test with verbose, above is in grouputils

```
statsmodels.tools.tests.test_grouputils.TestIndexGrouping.test_count_categories ... C:\Python27\envs\py3\lib\site-packages\pandas\core\categorical.py:414: FutureWarning: 'labels' is deprecated. Use 'codes' instead
  warnings.warn("'labels' is deprecated. Use 'codes' instead", FutureWarning)
ok
```

related
numpy issues a RuntimeWarning which might be just test noise, test output doesn't show location

```
nanfunctions.py:598: RuntimeWarning: Mean of empty slice
  warnings.warn("Mean of empty slice", RuntimeWarning)
```



Discussion:

Resolving patch:
diff --git a/statsmodels/tools/grouputils.py b/statsmodels/tools/grouputils.py
--- a/statsmodels/tools/grouputils.py
+++ b/statsmodels/tools/grouputils.py
@@ -374,9 +374,9 @@ def labels(self):
             # pandas < 0.15
             tmp = pd.Categorical(self.index)
             try:
-                labl = tmp.labels
-            except AttributeError:
                 labl = tmp.codes
+            except AttributeError:
+                labl = tmp.labels  # Old pandsd
 
             return labl[None]
 
diff --git a/statsmodels/tools/pca.py b/statsmodels/tools/pca.py
--- a/statsmodels/tools/pca.py
+++ b/statsmodels/tools/pca.py
@@ -401,6 +401,9 @@ def _prepare_data(self):
         Standardize or demean data.
         """
         adj_data = self._adjusted_data
+        if np.all(np.isnan(adj_data)):
+            return np.empty(adj_data.shape[1]).fill(np.nan)
+
         self._mu = nanmean(adj_data, axis=0)
         self._sigma = np.sqrt(nanmean((adj_data - self._mu) ** 2.0, axis=0))
         if self._standardize:


Test patch:
diff --git a/statsmodels/genmod/tests/test_gee.py b/statsmodels/genmod/tests/test_gee.py
--- a/statsmodels/genmod/tests/test_gee.py
+++ b/statsmodels/genmod/tests/test_gee.py
@@ -1442,8 +1442,7 @@ def test_missing():
                   cov_struct=sm.cov_struct.Independence(),
                   family=sm.families.Binomial())
 
-    df = df.dropna()
-    #df.loc[:, 'constant'] = 1
+    df = df.dropna().copy()
     df['constant'] = 1
 
     mod2 = GEE(df.status, df[['constant', 'fake']], groups=df.grps,
Repository: statsmodels/statsmodels

Issue:
(untested) use of deprecated numpy.unique1d
Original report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=659405

```
statsmodels/sandbox/regression/try_catdata.py:    unil, unilinv = np.unique1d(ys, return_index=False, return_inverse=True)
statsmodels/sandbox/regression/try_catdata.py:    ix,rind = np.unique1d(factors, return_inverse=1)
statsmodels/sandbox/regression/try_catdata.py:    unil, unilinv = np.unique1d(ylabel, return_index=False, return_inverse=True)
```

```
$> python -c 'import numpy as np; print np.__version__; print np.unique1d'
1.7.1
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'unique1d'
```



Discussion:
ancient code in a example/experimental script in the sandbox.
I thought we fixed this.
now we have numpy 1.6 minimum version


Resolving patch:
diff --git a/statsmodels/sandbox/regression/try_catdata.py b/statsmodels/sandbox/regression/try_catdata.py
--- a/statsmodels/sandbox/regression/try_catdata.py
+++ b/statsmodels/sandbox/regression/try_catdata.py
@@ -58,7 +58,7 @@ def labelmeanfilter_nd(y, x):
 def labelmeanfilter_str(ys, x):
     # works also for string labels in ys, but requires 1D
     # from mailing list scipy-user 2009-02-11
-    unil, unilinv = np.unique1d(ys, return_index=False, return_inverse=True)
+    unil, unilinv = np.unique(ys, return_index=False, return_inverse=True)
     labelmeans = np.array(ndimage.mean(x, labels=unilinv, index=np.arange(np.max(unil)+1)))
     arr3 = labelmeans[unilinv]
     return arr3
@@ -67,7 +67,7 @@ def groupstatsbin(factors, values):
     '''uses np.bincount, assumes factors/labels are integers
     '''
     n = len(factors)
-    ix,rind = np.unique1d(factors, return_inverse=1)
+    ix,rind = np.unique(factors, return_inverse=1)
     gcount = np.bincount(rind)
     gmean = np.bincount(rind, weights=values)/ (1.0*gcount)
     meanarr = gmean[rind]
@@ -93,7 +93,7 @@ def convertlabels(ys, indices=None):
             # there might be a problem here
             ylabel = ys
 
-    unil, unilinv = np.unique1d(ylabel, return_index=False, return_inverse=True)
+    unil, unilinv = np.unique(ylabel, return_index=False, return_inverse=True)
     return unilinv, np.arange(len(unil)), unil
 
 def groupsstats_1d(y, x, labelsunique):


Test patch:
Repository: statsmodels/statsmodels

Issue:
version number convention pep-440
https://github.com/scipy/scipy/pull/4307

just changes a `-` to `+`

we need the same change
line 228 in setup.py `FULLVERSION += '.dev-' + GIT_REVISION[:7]`
I have no idea if we need anything else



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -225,7 +225,7 @@ def write_version_py(filename=pjoin(curdir, 'statsmodels/version.py')):
         GIT_REVISION = "Unknown"
 
     if not ISRELEASED:
-        FULLVERSION += '.dev-' + GIT_REVISION[:7]
+        FULLVERSION += '.dev0+' + GIT_REVISION[:7]
 
 
     if dowrite:


Test patch:
Repository: statsmodels/statsmodels

Issue:
BUG VAR fit with trend='t' raises exception
with example from tutorial 

```
model_t = VAR(data_t)
results = model.fit(4, trend = 't')

---------------------------------------------------------------------------
UnboundLocalError                         Traceback (most recent call last)
<ipython-input-98-f7328095d596> in <module>()
      1 model_t = VAR(data_t)
----> 2 results = model.fit(4, trend = 't')

e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-all-new2_py27\statsmodels\statsmodels\tsa\vector_ar\var_model.py in fit(self, maxlags, method, ic, trend, verbose)
    429                 lags = 1
    430 
--> 431         k_trend = util.get_trendorder(trend)
    432         self.exog_names = util.make_lag_names(self.endog_names, lags, k_trend)
    433         self.nobs = len(self.endog) - lags

e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-all-new2_py27\statsmodels\statsmodels\tsa\vector_ar\util.pyc in get_trendorder(trend)
     45     elif trend == 'ctt':
     46         trendorder = 3
---> 47     return trendorder
     48 
     49 def make_lag_names(names, lag_order, trendorder=1):

UnboundLocalError: local variable 'trendorder' referenced before assignment

```



Discussion:

Resolving patch:
diff --git a/statsmodels/tsa/vector_ar/var_model.py b/statsmodels/tsa/vector_ar/var_model.py
--- a/statsmodels/tsa/vector_ar/var_model.py
+++ b/statsmodels/tsa/vector_ar/var_model.py
@@ -416,6 +416,9 @@ def fit(self, maxlags=None, method='ols', ic=None, trend='c',
         """
         lags = maxlags
 
+        if trend not in ['c', 'ct', 'ctt', 'nc']:
+            raise ValueError("trend '{}' not supported for VAR".format(trend))
+
         if ic is not None:
             selections = self.select_order(maxlags=maxlags, verbose=verbose)
             if ic not in selections:


Test patch:
diff --git a/statsmodels/tsa/vector_ar/tests/test_var.py b/statsmodels/tsa/vector_ar/tests/test_var.py
--- a/statsmodels/tsa/vector_ar/tests/test_var.py
+++ b/statsmodels/tsa/vector_ar/tests/test_var.py
@@ -577,6 +577,21 @@ def test_var_constant():
     model = VAR(data)
     assert_raises(ValueError, model.fit, 1)
 
+def test_var_trend():
+    # see 2271
+    data = get_macrodata().view((float,3))
+
+    model = sm.tsa.VAR(data)
+    results = model.fit(4) #, trend = 'c')
+    irf = results.irf(10)
+
+
+    data_nc = data - data.mean(0)
+    model_nc = sm.tsa.VAR(data_nc)
+    results_nc = model_nc.fit(4, trend = 'nc')
+    assert_raises(ValueError, model.fit, 4, trend='t')
+
+
 def test_irf_trend():
     # test for irf with different trend see #1636
     # this is a rough comparison by adding trend or subtracting mean to data
Repository: statsmodels/statsmodels

Issue:
ENH: ARIMA  mle_retvals missing
If we have a convergence failure in `fit`, then ARIMA provides the warning to check mle_retvals but it's not attached.



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
@@ -945,7 +945,6 @@ def fit(self, start_params=None, trend='c', method="css-mle",
         armafit = ARMAResults(self, params, normalized_cov_params)
         armafit.mle_retvals = mlefit.mle_retvals
         armafit.mle_settings = mlefit.mle_settings
-        armafit.mlefit = mlefit
         return ARMAResultsWrapper(armafit)
 
 
@@ -1102,14 +1101,18 @@ def fit(self, start_params=None, trend='c', method="css-mle",
         r, order = 'F')
 
         """
-        arima_fit = super(ARIMA, self).fit(start_params, trend,
+        mlefit = super(ARIMA, self).fit(start_params, trend,
                                            method, transparams, solver,
                                            maxiter, full_output, disp,
                                            callback, **kwargs)
         normalized_cov_params = None  # TODO: fix this?
-        arima_fit = ARIMAResults(self, arima_fit._results.params,
+        arima_fit = ARIMAResults(self, mlefit._results.params,
                                  normalized_cov_params)
         arima_fit.k_diff = self.k_diff
+
+        arima_fit.mle_retvals = mlefit.mle_retvals
+        arima_fit.mle_settings = mlefit.mle_settings
+
         return ARIMAResultsWrapper(arima_fit)
 
     def predict(self, params, start=None, end=None, exog=None, typ='linear',


Test patch:
Repository: statsmodels/statsmodels

Issue:
BUG: ARIMA exog_names expands in each fit.
trying out the example from test_arima. small sample

If I call fit repeatedly, then summary() raises an exception.

It looks like `exog_names` is appended in each call of fit.

```
    y = [-1214.360173, -1848.209905, -2100.918158, -3647.483678, -4711.186773]
    mod = ARIMA(y, (1, 0, 2))

>>> mod.exog_names
['const', 'const', 'const', 'ar.L1.y', 'ma.L1.y', 'ma.L2.y', 'ar.L1.y', 'ma.L1.y', 'ma.L2.y', 'ar.L1.y', 'ma.L1.y', 'ma.L2.y']

>>> res = mod.fit(disp=0, start_params=[np.mean(y), .1, .1, .1])
>>> mod.exog_names
['const', 'const', 'const', 'const', 'ar.L1.y', 'ma.L1.y', 'ma.L2.y', 'ar.L1.y', 'ma.L1.y', 'ma.L2.y', 'ar.L1.y', 'ma.L1.y', 'ma.L2.y', 'ar.L1.y', 'ma.L1.y', 'ma.L2.y']

>>> res = mod.fit(disp=0, start_params=[np.mean(y), .1, .1, .1])
>>> mod.exog_names
['const', 'const', 'const', 'const', 'const', 'ar.L1.y', 'ma.L1.y', 'ma.L2.y', 'ar.L1.y', 'ma.L1.y', 'ma.L2.y', 'ar.L1.y', 'ma.L1.y', 'ma.L2.y', 'ar.L1.y', 'ma.L1.y', 'ma.L2.y', 'ar.L1.y', 'ma.L1.y', 'ma.L2.y']
```

working in a plain Windows shell in py3.3 virtualenv



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
@@ -408,6 +408,14 @@ def _make_arma_names(data, k_trend, order, exog_names):
     ma_lag_names = util.make_lag_names([data.ynames], k_ma, 0)
     ma_lag_names = [''.join(('ma.', i)) for i in ma_lag_names]
     trend_name = util.make_lag_names('', 0, k_trend)
+
+    # ensure exog_names stays unchanged when the `fit` method
+    # is called multiple times.
+    if exog_names[-k_ma:] == ma_lag_names and \
+       exog_names[-(k_ar+k_ma):-k_ma] == ar_lag_names and \
+       (not exog_names or not trend_name or trend_name[0] == exog_names[0]):
+        return exog_names
+
     exog_names = trend_name + exog_names + ar_lag_names + ma_lag_names
     return exog_names
 


Test patch:
diff --git a/statsmodels/tsa/tests/test_arima.py b/statsmodels/tsa/tests/test_arima.py
--- a/statsmodels/tsa/tests/test_arima.py
+++ b/statsmodels/tsa/tests/test_arima.py
@@ -2210,6 +2210,14 @@ def test_ARIMA_exog_predict():
     assert_allclose(dpredict_002, res_d002[-len(dpredict_002):], rtol=1e-4, atol=1e-6)
 
 
+def test_arima_fit_mutliple_calls():
+    y = [-1214.360173, -1848.209905, -2100.918158, -3647.483678, -4711.186773]
+    mod = ARIMA(y, (1, 0, 2))
+    # Make multiple calls to fit
+    mod.fit(disp=0, start_params=[np.mean(y), .1, .1, .1])
+    assert_equal(mod.exog_names,  ['const', 'ar.L1.y', 'ma.L1.y', 'ma.L2.y']) 
+    mod.fit(disp=0, start_params=[np.mean(y), .1, .1, .1])
+    assert_equal(mod.exog_names,  ['const', 'ar.L1.y', 'ma.L1.y', 'ma.L2.y']) 
 
 if __name__ == "__main__":
     import nose
Repository: statsmodels/statsmodels

Issue:
tsa_arma_0 notebook (sunspot data) is outdated
Not so hard to fix (`isinvertible` and `isstationary` are now attributes; `generate_sample` now takes a `nsample` argument instead of `size`) but because the notebook format changed recently I cannot produce a clean patch.



Discussion:
related I ran into problems with one of the notebools on robust estimation.

@anntzer Thanks for reporting. 

Eventually we will have to do one noisy switch in format. I guess we still wait a little bit with it.
I'm currently still on the old format AFAIK, I'm seeing downgrade from format 3 to format 2 messages when I open notebooks, but I'm not up to date on ipython notebook development.

I have started to look at cleaning up some other notebooks and I should be able to fix this also.


Resolving patch:
diff --git a/examples/python/tsa_arma_0.py b/examples/python/tsa_arma_0.py
--- a/examples/python/tsa_arma_0.py
+++ b/examples/python/tsa_arma_0.py
@@ -124,26 +124,26 @@ def mean_forecast_err(y, yhat):
 arma_t = ArmaProcess(arparams, maparams)
 
 
-arma_t.isinvertible()
+arma_t.isinvertible
 
 
-arma_t.isstationary()
+arma_t.isstationary
 
 
 # * What does this mean?
 
 fig = plt.figure(figsize=(12,8))
 ax = fig.add_subplot(111)
-ax.plot(arma_t.generate_sample(size=50));
+ax.plot(arma_t.generate_sample(nsample=50));
 
 
 arparams = np.array([1, .35, -.15, .55, .1])
 maparams = np.array([1, .65])
 arma_t = ArmaProcess(arparams, maparams)
-arma_t.isstationary()
+arma_t.isstationary
 
 
-arma_rvs = arma_t.generate_sample(size=500, burnin=250, scale=2.5)
+arma_rvs = arma_t.generate_sample(nsample=500, burnin=250, scale=2.5)
 
 
 fig = plt.figure(figsize=(12,8))


Test patch:
Repository: statsmodels/statsmodels

Issue:
problems in example notebooks
- interaction_anova  minority.table http://stats191.stanford.edu/data/minority.table is no longer available



Discussion:
Still alive here: 
http://web.archive.org/web/20131019010037/http://www.stanford.edu/class/stats191/data/minority.table

google found a copy here https://github.com/tcdoan/stats/blob/master/regression/minority.table
(old version of stats 191 R examples)

Why would this example need to fetch the data from the Web when the file is available locally in the examples directory?

@josef-pkt Let me know if this is what the issue was about =)

@kiyoto  Updating the link is ok, but to avoid further problems with data files in examples I started our own smdatasets repository. 

AFAIR, It will be stored or cached locally after it has been fetched the first time the example is run.

ah I see. I guess the better way to address all of this is to update the link to files under https://github.com/statsmodels/smdatasets once they are available there.

What will you do to the local copies of *.table files once smdatasets is ready?


Resolving patch:
diff --git a/examples/python/interactions_anova.py b/examples/python/interactions_anova.py
--- a/examples/python/interactions_anova.py
+++ b/examples/python/interactions_anova.py
@@ -214,12 +214,12 @@
 # ## Minority Employment Data
 
 try:
-    minority_table = pd.read_table('minority.table')
+    jobtest_table = pd.read_table('jobtest.table')
 except:  # don't have data already
-    url = 'http://stats191.stanford.edu/data/minority.table'
-    minority_table = pd.read_table(url)
+    url = 'http://stats191.stanford.edu/data/jobtest.table'
+    jobtest_table = pd.read_table(url)
 
-factor_group = minority_table.groupby(['ETHN'])
+factor_group = jobtest_table.groupby(['ETHN'])
 
 plt.figure(figsize=(6,6))
 colors = ['purple', 'green']
@@ -230,7 +230,7 @@
 plt.xlabel('TEST');
 plt.ylabel('JPERF');
 
-min_lm = ols('JPERF ~ TEST', data=minority_table).fit()
+min_lm = ols('JPERF ~ TEST', data=jobtest_table).fit()
 print(min_lm.summary())
 
 plt.figure(figsize=(6,6));
@@ -243,7 +243,7 @@
 abline_plot(model_results = min_lm, ax=plt.gca());
 
 min_lm2 = ols('JPERF ~ TEST + TEST:ETHN',
-        data=minority_table).fit()
+        data=jobtest_table).fit()
 
 print(min_lm2.summary())
 
@@ -259,7 +259,7 @@
         ax=plt.gca(), color='green');
 
 
-min_lm3 = ols('JPERF ~ TEST + ETHN', data = minority_table).fit()
+min_lm3 = ols('JPERF ~ TEST + ETHN', data = jobtest_table).fit()
 print(min_lm3.summary())
 
 plt.figure(figsize=(6,6));
@@ -273,7 +273,7 @@
         slope = min_lm3.params['TEST'], ax=plt.gca(), color='green');
 
 
-min_lm4 = ols('JPERF ~ TEST * ETHN', data = minority_table).fit()
+min_lm4 = ols('JPERF ~ TEST * ETHN', data = jobtest_table).fit()
 print(min_lm4.summary())
 
 plt.figure(figsize=(6,6));


Test patch: