'confidence interval for the difference in means
Parameters
alpha : float
significance level for the confidence interval, coverage is
``1-alpha``
alternative : string
This specifies the alternative hypothesis for the test that
corresponds to the confidence interval.
The alternative hypothesis, H1, has to be one of the following :
\'two-sided\': H1: difference in means not equal to value (default)
\'larger\' :   H1: difference in means larger than value
\'smaller\' :  H1: difference in means smaller than value
usevar : string, \'pooled\' or \'unequal\'
If ``pooled``, then the standard deviation of the samples is assumed to be
the same. If ``unequal``, then Welsh ttest with Satterthwait degrees
of freedom is used
Returns
lower, upper : floats
lower and upper limits of the confidence interval
Notes
The result is independent of the user specified ddof.'

def zconfint_diff(self, alpha=0.05, alternative='two-sided', usevar='pooled'):

    d1 = self.d1
    d2 = self.d2
    diff = (d1.mean - d2.mean)
    if (usevar == 'pooled'):
        std_diff = self.std_meandiff_pooledvar
    elif (usevar == 'unequal'):
        std_diff = self.std_meandiff_separatevar
    else:
        raise ValueError('usevar    can    only    be    "pooled"    or    "unequal"')
    res = _zconfint_generic(diff, std_diff, alpha=alpha, alternative=alternative)
    return res
