
from statsmodels.sandbox.stats.multicomp import MultiComparison

def pairwise_tukeyhsd(endog, groups, alpha=0.05):
    '''calculate all pairwise comparisons with TukeyHSD confidence intervals

    this is just a wrapper around tukeyhsd method of MultiComparison

    Parameters
    ----------
    endog : ndarray, float, 1d
        response variable
    groups : ndarray, 1d
        array with groups, can be string or integers
    alpha : float
        significance level for the test

    Returns
    -------
    results : TukeyHSDResults instance
        A results class containing relevant data and some post-hoc
        calculations

    See Also
    --------
    MultiComparison
    tukeyhsd
    statsmodels.sandbox.stats.multicomp.TukeyHSDResults

    '''

    return MultiComparison(endog, groups).tukeyhsd(alpha=alpha)


from statsmodels.sandbox.stats.multicomp import tukeyhsd, MultiComparison

def pairwise_tukeyhsd(endog, groups, alpha=0.05):
    '''calculate all pairwise comparisons with TukeyHSD confidence intervals

    this is just a wrapper around tukeyhsd method of MultiComparison

    Parameters
    ----------
    endog : ndarray, float, 1d
        response variable
    groups : ndarray, 1d
        array with groups, can be string or integers
    alpha : float
        significance level for the test

    Returns
    -------
    results : TukeyHSDResults instance
        A results class containing relevant data and some post-hoc
        calculations

    See Also
    --------
    MultiComparison
    tukeyhsd
    statsmodels.sandbox.stats.multicomp.TukeyHSDResults

    '''

    return MultiComparison(endog, groups).tukeyhsd(alpha=alpha)

Put back an import that my IDE incorrectly flagged as unused
Put back an import that my IDE incorrectly flagged as unused

  
- from statsmodels.sandbox.stats.multicomp import MultiComparison
+ from statsmodels.sandbox.stats.multicomp import tukeyhsd, MultiComparison
  
  def pairwise_tukeyhsd(endog, groups, alpha=0.05):
      '''calculate all pairwise comparisons with TukeyHSD confidence intervals
  
      this is just a wrapper around tukeyhsd method of MultiComparison
  
      Parameters
      ----------
      endog : ndarray, float, 1d
          response variable
      groups : ndarray, 1d
          array with groups, can be string or integers
      alpha : float
          significance level for the test
  
      Returns
      -------
      results : TukeyHSDResults instance
          A results class containing relevant data and some post-hoc
          calculations
  
      See Also
      --------
      MultiComparison
      tukeyhsd
      statsmodels.sandbox.stats.multicomp.TukeyHSDResults
  
      '''
  
      return MultiComparison(endog, groups).tukeyhsd(alpha=alpha)
  
Put back an import that my IDE incorrectly flagged as unused
## Code Before:

from statsmodels.sandbox.stats.multicomp import MultiComparison

def pairwise_tukeyhsd(endog, groups, alpha=0.05):
    '''calculate all pairwise comparisons with TukeyHSD confidence intervals

    this is just a wrapper around tukeyhsd method of MultiComparison

    Parameters
    ----------
    endog : ndarray, float, 1d
        response variable
    groups : ndarray, 1d
        array with groups, can be string or integers
    alpha : float
        significance level for the test

    Returns
    -------
    results : TukeyHSDResults instance
        A results class containing relevant data and some post-hoc
        calculations

    See Also
    --------
    MultiComparison
    tukeyhsd
    statsmodels.sandbox.stats.multicomp.TukeyHSDResults

    '''

    return MultiComparison(endog, groups).tukeyhsd(alpha=alpha)

## Instruction:
Put back an import that my IDE incorrectly flagged as unused
## Code After:

from statsmodels.sandbox.stats.multicomp import tukeyhsd, MultiComparison

def pairwise_tukeyhsd(endog, groups, alpha=0.05):
    '''calculate all pairwise comparisons with TukeyHSD confidence intervals

    this is just a wrapper around tukeyhsd method of MultiComparison

    Parameters
    ----------
    endog : ndarray, float, 1d
        response variable
    groups : ndarray, 1d
        array with groups, can be string or integers
    alpha : float
        significance level for the test

    Returns
    -------
    results : TukeyHSDResults instance
        A results class containing relevant data and some post-hoc
        calculations

    See Also
    --------
    MultiComparison
    tukeyhsd
    statsmodels.sandbox.stats.multicomp.TukeyHSDResults

    '''

    return MultiComparison(endog, groups).tukeyhsd(alpha=alpha)
