예제 #1
0
 def get_summary(self, alpha, digits):
     """
     :param alpha: significance level
     :param digits: digits to round the numbers to
     :return: a list ['name', 'mean', 'confidence interval', 'percentile interval', 'st dev', 'min', 'max']
     """
     return [self._name,
             Support.format_number(self.get_mean(), digits),
             Support.format_interval(self.get_t_CI(alpha), digits),
             Support.format_interval(self.get_PI(alpha), digits),
             Support.format_number(self.get_stdev(), digits),
             Support.format_number(self.get_min(), digits),
             Support.format_number(self.get_max(), digits)]
예제 #2
0
def print_results(stat):
    print('   Average =', Support.format_number(stat.get_mean(), digits=3))
    print('   St Dev =', Support.format_number(stat.get_stdev(), digits=3))
    print('   Min =', Support.format_number(stat.get_min(), digits=3))
    print('   Max =', Support.format_number(stat.get_max(), digits=3))
    print('   Median =',
          Support.format_number(stat.get_percentile(50), digits=3))
    print('   95% Mean Confidence Interval (t-based) =',
          Support.format_interval(stat.get_t_CI(0.05), 3))
    print('   95% Mean Confidence Interval (bootstrap) =',
          Support.format_interval(stat.get_bootstrap_CI(0.05, 1000), 3))
    print('   95% Percentile Interval =',
          Support.format_interval(stat.get_PI(0.05), 3))