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

Issue:
ENH: Add support for PeriodIndex to AutoReg
Currently produces an error for DataFrames with PeriodIndex.



Discussion:
Have to add a test that uses a period index.

[![Coverage Status](https://coveralls.io/builds/31321111/badge)](https://coveralls.io/builds/31321111)

Coverage decreased (-0.0007%) to 87.843% when pulling **5b9b7c4e9a0e85429b54137376a594cb66482174 on ipsq:patch-1** into **ee9f5c0bd7ee7f646bdbaf31fbc295e5a0ab02f8 on statsmodels:master**.

@ipsq Any change you could make the requested changes?

Resolving patch:
diff --git a/statsmodels/tsa/ar_model.py b/statsmodels/tsa/ar_model.py
--- a/statsmodels/tsa/ar_model.py
+++ b/statsmodels/tsa/ar_model.py
@@ -366,7 +366,7 @@ def fit(self, cov_type='nonrobust', cov_kwds=None, use_t=False):
             * 'HAC' - Heteroskedasticity-autocorrelation robust covariance
               estimation. Supports cov_kwds.
 
-              - `maxlag` integer (required) : number of lags to use.
+              - `maxlags` integer (required) : number of lags to use.
               - `kernel` callable or str (optional) : kernel
                   currently available kernels are ['bartlett', 'uniform'],
                   default is Bartlett.
@@ -521,7 +521,10 @@ def _wrap_prediction(self, prediction, start, end):
         if end > self.endog.shape[0]:
             freq = getattr(index, 'freq', None)
             if freq:
-                index = pd.date_range(index[0], freq=freq, periods=end)
+                if isinstance(index, pd.PeriodIndex):
+                    index = pd.period_range(index[0], freq=freq, periods=end)
+                else:
+                    index = pd.date_range(index[0], freq=freq, periods=end)
             else:
                 index = pd.RangeIndex(end)
         index = index[start:end]


Test patch:
diff --git a/statsmodels/tsa/tests/test_ar.py b/statsmodels/tsa/tests/test_ar.py
--- a/statsmodels/tsa/tests/test_ar.py
+++ b/statsmodels/tsa/tests/test_ar.py
@@ -1264,3 +1264,14 @@ def test_autoreg_predict_forecast_equiv(reset_randomstate):
     sarimax_res = SARIMAX(y, order=(1, 0, 0), trend="c").fit(disp=False)
     d = sarimax_res.forecast(12)
     pd.testing.assert_index_equal(a.index, d.index)
+
+
+def test_autoreg_forecast_period_index():
+    pi = pd.period_range("1990-1-1", periods=524, freq="M")
+    y = np.random.RandomState(0).standard_normal(500)
+    ys = pd.Series(y, index=pi[:500], name="y")
+    mod = AutoReg(ys, 3, seasonal=True, old_names=False)
+    res = mod.fit()
+    fcast = res.forecast(24)
+    assert isinstance(fcast.index, pd.PeriodIndex)
+    pd.testing.assert_index_equal(fcast.index, pi[-24:])
Repository: statsmodels/statsmodels

Issue:
Possible typo on  the page
[On this page](https://www.statsmodels.org/stable/generated/statsmodels.tsa.statespace.exponential_smoothing.ExponentialSmoothing.html) under notes, it's written that _the statespace exponential smoothing is worse than sm.tsa.ExponentialSmoothing_ There is no sm.tsa.ExponentialSmoothing class. Did you mean sm.tsa.holtwinters.ExponentialSmoothing ? Please clarify and please add a link to the referenced class.

Thanks


Discussion:
It should just say `tsa.ExponentialSmoothing` which uses the canonical reference to `import statsmodels.tsa.api as tsa`.

Resolving patch:
diff --git a/statsmodels/tsa/statespace/exponential_smoothing.py b/statsmodels/tsa/statespace/exponential_smoothing.py
--- a/statsmodels/tsa/statespace/exponential_smoothing.py
+++ b/statsmodels/tsa/statespace/exponential_smoothing.py
@@ -80,8 +80,8 @@ class ExponentialSmoothing(MLEModel):
     exponential smoothing equations as a special case of a linear Gaussian
     state space model and applying the Kalman filter. As such, it has slightly
     worse performance than the dedicated exponential smoothing model,
-    `sm.tsa.ExponentialSmoothing`, and it does not support multiplicative
-    (nonlinear) exponential smoothing models.
+    :class:`statsmodels.tsa.holtwinters.ExponentialSmoothing`, and it does not
+    support multiplicative (nonlinear) exponential smoothing models.
 
     However, as a subclass of the state space models, this model class shares
     a consistent set of functionality with those models, which can make it


Test patch:
Repository: statsmodels/statsmodels

Issue:
diagnostic.ResultsStore __str__ method will break
```
def __str__(self):
    return self._str
```

but there is no `_str` attribute.


Discussion:
AFAICS only HetGoldfeldQuandt  adds the specific `_str` attribute



Resolving patch:
diff --git a/statsmodels/tsa/stattools.py b/statsmodels/tsa/stattools.py
--- a/statsmodels/tsa/stattools.py
+++ b/statsmodels/tsa/stattools.py
@@ -60,13 +60,6 @@
 SQRTEPS = np.sqrt(np.finfo(np.double).eps)
 
 
-# NOTE: now in two places to avoid circular import
-# TODO: I like the bunch pattern for this too.
-class ResultsStore(object):
-    def __str__(self):
-        return self._str  # pylint: disable=E1101
-
-
 def _autolag(
     mod,
     endog,
@@ -299,6 +292,8 @@ def adfuller(
     xdshort = xdiff[-nobs:]
 
     if store:
+        from statsmodels.stats.diagnostic import ResultsStore
+
         resstore = ResultsStore()
     if autolag:
         if regression != "nc":
@@ -1911,6 +1906,8 @@ def kpss(x, regression="c", nlags=None, store=False):
     crit_dict = {"10%": crit[0], "5%": crit[1], "2.5%": crit[2], "1%": crit[3]}
 
     if store:
+        from statsmodels.stats.diagnostic import ResultsStore
+
         rstore = ResultsStore()
         rstore.lags = nlags
         rstore.nobs = nobs


Test patch:
Repository: statsmodels/statsmodels

Issue:
TypeError unexpected keyword argument 'missing_idx' when using Var.from_formula()
When I try to specify a VAR model from a formula I get an error about an unexpected keyword argument that seems to be a default.

```
import statsmodels.api as sm
import pandas
import numpy
import datetime

df = pandas.DataFrame(numpy.random.rand(100,4), columns=['A', 'B', 'C', 'D'])
df.index = pandas.DatetimeIndex(periods=100, freq='1D', start=datetime.datetime(2015,1,1))
model_spec = 'A ~ B + C'
var_model = statsmodels.tsa.VAR.from_formula(model_spec, df )
```

Produced the following error:

```
from_formula(cls, formula, data, subset, *args, **kwargs)
    148         kwargs.update({'missing_idx': missing_idx,
    149                        'missing': missing})
--> 150         mod = cls(endog, exog, *args, **kwargs)
    151         mod.formula = formula
    152 

TypeError: __init__() got an unexpected keyword argument 'missing_idx'
```

I think this is because the constructor for the var_model class doesn't take the same keyword arguments as the base model class.



Discussion:
`from_formula` doesn't make much sense for VAR. VAR doesn't have `exog` explanatory variables, and all we need is the multivariate `endog`.

I think it should raise a NotImplementedError, I didn't even know time series models inherit from_formula.

Var is a different type of model than the base model because endog is multivariate, and AFAIR, there are other inherited methods that are not yet correctly overwritten in the subclasses.


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
@@ -583,7 +583,7 @@ def fit(self, maxlags=None, method='ols', ic=None, trend='c',
 
         Parameters
         ----------
-        maxlags : int
+        maxlags : {int, None}, default None
             Maximum number of lags to check for order selection, defaults to
             12 * (nobs/100.)**(1./4), see select_order function
         method : {'ols'}
@@ -773,6 +773,14 @@ def select_order(self, maxlags=None, trend="c"):
 
         return LagOrderResults(ics, selected_orders, vecm=False)
 
+    @classmethod
+    def from_formula(cls, formula, data, subset=None, drop_cols=None,
+                     *args, **kwargs):
+        """
+        Not implemented. Formulas are not supported for VAR models.
+        """
+        raise NotImplementedError("formulas are not supported for VAR models.")
+
 
 class VARProcess(object):
     """


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
@@ -871,3 +871,8 @@ def test_var_maxlag(reset_randomstate):
     VAR(y).fit(maxlags=None, ic="aic")
     with pytest.raises(ValueError, match="maxlags is too large"):
         VAR(y).fit(maxlags=8, ic="aic")
+
+
+def test_from_formula():
+    with pytest.raises(NotImplementedError):
+        VAR.from_formula("y ~ x", None)
Repository: statsmodels/statsmodels

Issue:
BUG: remove k_extra from effects_idx
currently just parking a commit with possible solution, needs unit tests.

I ran several cases for NB and GP and they worked after this commit.
I don't see why this extension of effect_idx is needed anymore. Maybe something else fixed the initial problem with margins in NegBin

closes #6763



- [ ] tests added / passed. 
- [ ] code/documentation is well formatted.  






Discussion:

Resolving patch:
diff --git a/statsmodels/discrete/discrete_margins.py b/statsmodels/discrete/discrete_margins.py
--- a/statsmodels/discrete/discrete_margins.py
+++ b/statsmodels/discrete/discrete_margins.py
@@ -671,8 +671,6 @@ def get_margeff(self, at='overall', method='dydx', atexog=None,
         params = results.params
         exog = model.exog.copy() # copy because values are changed
         effects_idx, const_idx =  _get_const_index(exog)
-        if hasattr(model, 'k_extra') and model.k_extra > 0:
-            effects_idx = np.concatenate((effects_idx, np.zeros(model.k_extra, np.bool_)))
 
         if dummy:
             _check_discrete_args(at, method)


Test patch:
Repository: statsmodels/statsmodels

Issue:
Add docstring to string_like method
Add docstring to string_like method



Discussion:

Resolving patch:
diff --git a/statsmodels/tools/validation/validation.py b/statsmodels/tools/validation/validation.py
--- a/statsmodels/tools/validation/validation.py
+++ b/statsmodels/tools/validation/validation.py
@@ -91,6 +91,7 @@ def array_like(
     >>> a = array_like(pd.Series(x), 'x', ndim=1)
     >>> a.shape
     (4,)
+
     >>> type(a.orig)
     pandas.core.series.Series
 
@@ -395,6 +396,34 @@ def float_like(value, name, optional=False, strict=False):
 
 
 def string_like(value, name, optional=False, options=None, lower=True):
+    """
+    Check if object is string-like and raise if not
+
+    Parameters
+    ----------
+    value : object
+        Value to verify.
+    name : str
+        Variable name for exceptions.
+    optional : bool
+        Flag indicating whether None is allowed.
+    options : tuple[str]
+        Allowed values for input parameter `value`.
+    lower : bool
+        Convert all case-based characters in `value` into lowercase.
+
+    Returns
+    -------
+    str
+        The validated input
+
+    Raises
+    ------
+    TypeError
+        If the value is not a string or None when optional is True.
+    ValueError
+        If the input is not in ``options`` when ``options`` is set.
+    """
     if value is None:
         return None
     if not isinstance(value, str):


Test patch:
Repository: statsmodels/statsmodels

Issue:
BUG: QIC calculation in GEE is wrong?
I was reading through the QIC code for GEE [here](https://www.statsmodels.org/stable/_modules/statsmodels/genmod/generalized_estimating_equations.html#GEE.qic) and was wondering if `du = means - self.endog` should be `du = means - endog_li` instead. The `means` arrays generated by the below code is sorted by groups, shouldn't the endogenous variable be sorted by groups too?

```
  means = []
  omega = 0.0
  # omega^-1 is the model-based covariance assuming independence

  for i in range(self.num_group):
      expval, lpr = self.cached_means[i]
      means.append(expval)
      dmat = self.mean_deriv(self.exog_li[i], lpr)
      omega += np.dot(dmat.T, dmat) / scale

  means = np.concatenate(means)
```

If that's right then the corrected version should have

```
endog_li = np.concatenate(self.endog_li)
du = means - endog_li
nstep = 10000
qv = np.empty(nstep)
xv = np.linspace(-0.99999, 1, nstep)
for i, g in enumerate(xv):
    u = endog_li + (g + 1) * du / 2.0
    vu = varfunc(u)
    qv[i] = -np.sum(du**2 * (g + 1) / vu)
qv /= (4 * scale)
```

instead of

```
du = means - self.endog
nstep = 10000
qv = np.empty(nstep)
xv = np.linspace(-0.99999, 1, nstep)
for i, g in enumerate(xv):
    u = self.endog + (g + 1) * du / 2.0
    vu = varfunc(u)
    qv[i] = -np.sum(du**2 * (g + 1) / vu)
qv /= (4 * scale)
```


Discussion:

Resolving patch:
diff --git a/statsmodels/genmod/generalized_estimating_equations.py b/statsmodels/genmod/generalized_estimating_equations.py
--- a/statsmodels/genmod/generalized_estimating_equations.py
+++ b/statsmodels/genmod/generalized_estimating_equations.py
@@ -1721,12 +1721,13 @@ def qic(self, params, scale, cov_params):
 
         # The quasi-likelihood, use change of variables so the integration is
         # from -1 to 1.
-        du = means - self.endog
+        endog_li = np.concatenate(self.endog_li)
+        du = means - endog_li
         nstep = 10000
         qv = np.empty(nstep)
         xv = np.linspace(-0.99999, 1, nstep)
         for i, g in enumerate(xv):
-            u = self.endog + (g + 1) * du / 2.0
+            u = endog_li + (g + 1) * du / 2.0
             vu = varfunc(u)
             qv[i] = -np.sum(du**2 * (g + 1) / vu)
         qv /= (4 * scale)


Test patch:
Repository: statsmodels/statsmodels

Issue:
ENH: Drop testing and official support for Win32 and other 32-bit platforms
It is becoming more difficult to support win32 as some wheel builders are stopping support.  Should we stop testing on Win32?  

This seems reasonable to be.


Discussion:
I'm fine with dropping Win32. I have not heard anything running that in a long time.

For other 32bit: Are there small or embedded devices based on Linux that we might still want to support?
We don't test Linux32 or arm (too slow), so no one knows. I fixed the win32 CI for now, so it can stay, but I think its days are numbered until upstream also drop (probably pandas first).

Resolving patch:
diff --git a/tools/nbgenerate.py b/tools/nbgenerate.py
--- a/tools/nbgenerate.py
+++ b/tools/nbgenerate.py
@@ -1,6 +1,7 @@
 #!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 import argparse
+import asyncio
 from functools import partial
 import hashlib
 import io
@@ -21,6 +22,10 @@
 except ImportError:
     has_futures = False
 
+if sys.platform == 'win32':
+    # Set the policy to prevent "Event loop is closed" error on Windows
+    # https://github.com/encode/httpx/issues/914
+    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
 
 init()
 


Test patch:
Repository: statsmodels/statsmodels

Issue:
BUG: Code bug in statsmodels.tsa.forecasting.theta.ThetaModelResults.forecast_components
#### Describe the bug

[The forecast seasonal value is 1 step later than its actual value. see link below: https://www.statsmodels.org/stable/_modules/statsmodels/tsa/forecasting/theta.html#ThetaModel]

#### Bug Code
oos_idx = nobs + np.arange(1, steps + 1)

#### The bug should be corrected as 
oos_idx = nobs + np.arange(steps)
```


Discussion:

Resolving patch:
diff --git a/statsmodels/tsa/forecasting/theta.py b/statsmodels/tsa/forecasting/theta.py
--- a/statsmodels/tsa/forecasting/theta.py
+++ b/statsmodels/tsa/forecasting/theta.py
@@ -462,7 +462,7 @@ def forecast_components(self, steps: int = 1) -> pd.DataFrame:
         if self.model.deseasonalize:
             seasonal = self._seasonal
             period = self.model.period
-            oos_idx = nobs + np.arange(1, steps + 1)
+            oos_idx = nobs + np.arange(steps)
             seasonal_locs = oos_idx % period
             if seasonal.shape[0]:
                 season[:] = seasonal[seasonal_locs]


Test patch:
diff --git a/statsmodels/tsa/forecasting/tests/test_theta.py b/statsmodels/tsa/forecasting/tests/test_theta.py
--- a/statsmodels/tsa/forecasting/tests/test_theta.py
+++ b/statsmodels/tsa/forecasting/tests/test_theta.py
@@ -116,3 +116,20 @@ def test_pi_width():
     pi = res.prediction_intervals(24)
     d = np.squeeze(np.diff(np.asarray(pi), axis=1))
     assert np.all(np.diff(d) > 0)
+
+
+# GH7544
+@pytest.mark.parametrize("period", [4, 12])
+def test_forecast_seasonal_alignment(data, period):
+    res = ThetaModel(
+        data,
+        period=period,
+        deseasonalize=True,
+        use_test=False,
+        difference=False,
+    ).fit(use_mle=False)
+    seasonal = res._seasonal
+    comp = res.forecast_components(32)
+    index = np.arange(data.shape[0], data.shape[0] + comp.shape[0])
+    expected = seasonal[index % period]
+    np.testing.assert_allclose(comp.seasonal, expected)
Repository: statsmodels/statsmodels

Issue:
Wrong import in tsa.deterministic.Fourier example

The current example for generating Fourier decomposition terms is not importing Fourier correctly.

```
from statsmodels.datasets import sunspots
from statsmodels.tsa.deterministic import Seasonality
data = sunspots.load_pandas().data
fourier_gen = Fourier(11, order=2)
fourier_gen.in_sample(data.index)
```

#### Expected Output

Dataframe containing fourier terms

#### Output

NameError: name 'Fourier' is not defined


The fix is really simple, just need to change `import Seasonality` to `import Fourier`





Discussion:

Resolving patch:
diff --git a/statsmodels/tsa/deterministic.py b/statsmodels/tsa/deterministic.py
--- a/statsmodels/tsa/deterministic.py
+++ b/statsmodels/tsa/deterministic.py
@@ -494,7 +494,7 @@ class Fourier(FourierDeterministicTerm):
     Solar data has an 11-year cycle
 
     >>> from statsmodels.datasets import sunspots
-    >>> from statsmodels.tsa.deterministic import Seasonality
+    >>> from statsmodels.tsa.deterministic import Fourier
     >>> data = sunspots.load_pandas().data
     >>> fourier_gen = Fourier(11, order=2)
     >>> fourier_gen.in_sample(data.index)


Test patch:
Repository: statsmodels/statsmodels

Issue:
Use .2g for formatting mean_diff_plot annotations
#### Is your feature request related to a problem? Please describe

When using mean_diff_plot, it shows mean and +-sd.

The numbers are currently rounded to two digits:
https://github.com/statsmodels/statsmodels/blob/77bb1d276c7d11bc8657497b4307aa7575c3e65c/statsmodels/graphics/agreement.py#L132

However, if you put in small numbers, you will see zeros everywhere:
![image](https://user-images.githubusercontent.com/431045/115519431-7dd0fe80-a289-11eb-94ca-ee702ea471ff.png)

```
>>> import numpy as np
>>> import statsmodels.api as sm
>>> import matplotlib.pyplot as plt
>>> sm.graphics.mean_diff_plot(np.random.normal(0.000001, 0.0000001, 10), np.random.normal(0.0000015, 0.000001, 10))
<Figure size 640x480 with 1 Axes>
>>> plt.show()
```

#### Describe the solution you'd like

It should print some number which is not 0.0 - which is misleading.
Maybe using `.2g` as format would be a good, i.e.,:
```
 ax.annotate('-SD{}: {:.2g}'.format(sd_limit, lower), [...]
```

Example:
```
>>> f'{0.000001:.2g}'
'1e-06'
>>> f'{0.01:.2g}'
'0.01'
```

#### Describe alternatives you have considered
There are obviously many different formatting options... I'm not sure which one would be most fitting.





Discussion:
A PR would be welcome.
I can do that but what would be an appropriate format? Or should that be an additional argument to the function?
0.2g sounds reasonable.  Ideally that would be passable as a new *kwds argument like that would allow the annotations to be reformatted.

https://github.com/statsmodels/statsmodels/blob/77bb1d276c7d11bc8657497b4307aa7575c3e65c/statsmodels/graphics/agreement.py#L48

Maybe a dict wouldn't work since this isn't really a matplotlib keyword arg.  

Resolving patch:
diff --git a/statsmodels/graphics/agreement.py b/statsmodels/graphics/agreement.py
--- a/statsmodels/graphics/agreement.py
+++ b/statsmodels/graphics/agreement.py
@@ -129,13 +129,13 @@ def mean_diff_plot(m1, m2, sd_limit=1.96, ax=None, scatter_kwds=None,
         upper = mean_diff + limit_of_agreement
         for j, lim in enumerate([lower, upper]):
             ax.axhline(lim, **limit_lines_kwds)
-        ax.annotate('-SD{}: {}'.format(sd_limit, np.round(lower, 2)),
+        ax.annotate(f'-SD{sd_limit}: {lower:0.2g}',
                     xy=(0.99, 0.07),
                     horizontalalignment='right',
                     verticalalignment='bottom',
                     fontsize=14,
                     xycoords='axes fraction')
-        ax.annotate('+SD{}: {}'.format(sd_limit, np.round(upper, 2)),
+        ax.annotate(f'+SD{sd_limit}: {lower:0.2g}',
                     xy=(0.99, 0.92),
                     horizontalalignment='right',
                     fontsize=14,


Test patch:
Repository: statsmodels/statsmodels

Issue:
DOC: Version dropdown is not correct even though the json file is
#### Describe the bug

The version dropdown is not being picked up correctly for some reason.  Need to check if it is hard coded and not using the json file.



Discussion:

Resolving patch:
diff --git a/docs/source/conf.py b/docs/source/conf.py
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -189,7 +189,7 @@
                'examples/index': 'examples and tutorials to get started with '
                                  'statsmodels'},
     "version_dropdown": True,
-    "version_json": "_static/versions.json",
+    "version_json": "../versions.json",
 }
 
 language = 'en'


Test patch:
Repository: statsmodels/statsmodels

Issue:
BUG: fix percentiles being dropped in Description frame.
- [x] closes #7316
- [x] tests added / passed. 
- [x] code/documentation is well formatted.  
- [x] properly formatted commit message

@bashtage I am not very familiar with this function, so if you have a moment to check if I did something sensible, that would be great!


Discussion:

Resolving patch:
diff --git a/statsmodels/stats/descriptivestats.py b/statsmodels/stats/descriptivestats.py
--- a/statsmodels/stats/descriptivestats.py
+++ b/statsmodels/stats/descriptivestats.py
@@ -525,6 +525,9 @@ def _safe_jarque_bera(c):
             output = f"{{0:{fmt}}}%"
             perc.index = [output.format(val) for val in index]
 
+        # Add in the names of the percentiles to the output
+        self._stats = self._stats + perc.index.tolist()
+
         return self._reorder(pd.concat([results_df, perc], axis=0))
 
     @cache_readonly


Test patch:
diff --git a/statsmodels/stats/tests/test_descriptivestats.py b/statsmodels/stats/tests/test_descriptivestats.py
--- a/statsmodels/stats/tests/test_descriptivestats.py
+++ b/statsmodels/stats/tests/test_descriptivestats.py
@@ -164,7 +164,15 @@ def test_description_basic(df):
 def test_odd_percentiles(df):
     percentiles = np.linspace(7.0, 93.0, 13)
     res = Description(df, percentiles=percentiles)
-    print(res.frame.index)
+    stats = [
+        'nobs', 'missing', 'mean', 'std_err', 'upper_ci', 'lower_ci', 'std',
+        'iqr', 'iqr_normal', 'mad', 'mad_normal', 'coef_var', 'range', 'max',
+        'min', 'skew', 'kurtosis', 'jarque_bera', 'jarque_bera_pval', 'mode',
+        'mode_freq', 'median', 'distinct', 'top_1', 'top_2', 'top_3', 'top_4',
+        'top_5', 'freq_1', 'freq_2', 'freq_3', 'freq_4', 'freq_5', '7.0%',
+        '14.1%', '21.3%', '28.5%', '35.6%', '42.8%', '50.0%', '57.1%', '64.3%',
+        '71.5%', '78.6%', '85.8%', '93.0%']
+    assert_equal(res.frame.index.tolist(), stats)
 
 
 def test_large_ntop(df):