/// <summary> /// confidence level is alpha /// </summary> /// <param name="alpha"></param> /// <returns></returns> public ClosedNeighborhood <double> meanDifferenceConfidenceInterval(int levelA, int levelB, double confidenceLevel) { return(new ClosedNeighborhood <double>( observationsAverageByLevel(levelA) - observationsAverageByLevel(levelB), TDistribution.UpperDividePoint((1 - confidenceLevel) / 2, this.degreesOfFreedomError) * ((errorSquareAverage * (1.0 / observationsCountByLevel(levelA) + 1.0 / observationsCountByLevel(levelB)) ).Power(.5)) )); }