'see class docstring'

def run(self, y, x, idx=None, split=None, drop=None, alternative='increasing', attach=True):

    x = np.asarray(x)
    y = np.asarray(y)
    (nobs, nvars) = x.shape
    if (split is None):
        split = (nobs // 2)
    elif ((0 < split) and (split < 1)):
        split = int((nobs * split))
    if (drop is None):
        start2 = split
    elif ((0 < drop) and (drop < 1)):
        start2 = (split + int((nobs * drop)))
    else:
        start2 = (split + drop)
    if (not (idx is None)):
        xsortind = np.argsort(x[:, idx])
        y = y[xsortind]
        x = x[xsortind, :]
    resols1 = OLS(y[:split], x[:split]).fit()
    resols2 = OLS(y[start2:], x[start2:]).fit()
    fval = (resols2.mse_resid / resols1.mse_resid)
    if (alternative.lower() in ['i', 'inc', 'increasing']):
        fpval = stats.f.sf(fval, resols1.df_resid, resols2.df_resid)
        ordering = 'increasing'
    elif (alternative.lower() in ['d', 'dec', 'decreasing']):
        fval = fval
        fpval = stats.f.sf((1.0 / fval), resols2.df_resid, resols1.df_resid)
        ordering = 'decreasing'
    elif (alternative.lower() in ['2', '2-sided', 'two-sided']):
        fpval_sm = stats.f.cdf(fval, resols2.df_resid, resols1.df_resid)
        fpval_la = stats.f.sf(fval, resols2.df_resid, resols1.df_resid)
        fpval = (2 * min(fpval_sm, fpval_la))
        ordering = 'two-sided'
    else:
        raise ValueError('invalid    alternative')
    if attach:
        res = self
        res.__doc__ = 'Test    Results    for    Goldfeld-Quandt    test    of    heterogeneity'
        res.fval = fval
        res.fpval = fpval
        res.df_fval = (resols2.df_resid, resols1.df_resid)
        res.resols1 = resols1
        res.resols2 = resols2
        res.ordering = ordering
        res.split = split
        res._str = ('The    Goldfeld-Quandt    test    for    null    hypothesis    that    the\n                variance    in    the    second    subsample    is    %s    than    in    the    first    subsample:\n                                F-statistic    =%8.4f    and    p-value    =%8.4f' % (ordering, fval, fpval))
    return (fval, fpval, ordering)
