def run_paired_t(bt, s1, s2):
 test_stats = []
 pvals = []
 s1_indices = [bt.index(i, axis='sample') for i in s1]
 s2_indices = [bt.index(i, axis='sample') for i in s2]
 for data in bt.iter_data(axis='observation'):
  (test_stat, pval) = t_paired(data.take(s1_indices), data.take(s2_indices))
  test_stats.append(test_stat)
  pvals.append(pval)
 return (test_stats, pvals)

def run_paired_t ( bt , s1 , s2 ) : test_stats = [ ] pvals = [ ] s1_indices = [ bt . index ( i , axis = 'sample' ) for i in s1 ] s2_indices = [ bt . index ( i , axis = 'sample' ) for i in s2 ] for data in bt . iter_data ( axis = 'observation' ) : ( test_stat , pval ) = t_paired ( data . take ( s1_indices ) , data . take ( s2_indices ) ) test_stats . append ( test_stat ) pvals . append ( pval ) return ( test_stats , pvals )
perform a paired t test between samples .