#NEWLINE# def FalseNegRate( data , num_runs = 1000 ) : #NEWLINE# #INDENT# 'Computes the chance of a false negative based on resampling.\n\n    data: pair of sequences\n    num_runs: how many experiments to simulate\n\n    returns: float false negative rate\n    ' #NEWLINE# ( group1 , group2 ) = data #NEWLINE# count = 0 #NEWLINE# for i in range ( num_runs ) : #NEWLINE# #INDENT# sample1 = thinkstats2 . Resample ( group1 ) #NEWLINE# sample2 = thinkstats2 . Resample ( group2 ) #NEWLINE# ht = DiffMeansPermute ( ( sample1 , sample2 ) ) #NEWLINE# p_value = ht . PValue ( iters = 101 ) #NEWLINE# if ( p_value > 0.05 ) : #NEWLINE# #INDENT# count += 1 #NEWLINE# #UNINDENT# #UNINDENT# return ( count / num_runs )