Difference between revisions of "Eleisha's Segment 15: The Towne Family - Again"

From Computational Statistics Course Wiki
Jump to navigation Jump to search
(Created page with " <b>To Calculate: </b> 1. In slide 4, we used "posterior predictive p-value" to get the respective p-values 1.0e-13, .01, .12, and .0013. What if we had mistakenly just used ...")
 
Line 3: Line 3:
  
 
1. In slide 4, we used "posterior predictive p-value" to get the respective p-values 1.0e-13, .01, .12, and .0013. What if we had mistakenly just used the maximum likelihood estimate r=0.003, instead of integrating over r? What p-values would we have obtained?
 
1. In slide 4, we used "posterior predictive p-value" to get the respective p-values 1.0e-13, .01, .12, and .0013. What if we had mistakenly just used the maximum likelihood estimate r=0.003, instead of integrating over r? What p-values would we have obtained?
 +
You can easily use python to calculate the p-value for each of the Townes using the PDF of a binomial distribution. Below are the p-values
 +
<pre>
 +
P-value for T2: 7.82096716379e-23
 +
P-value for T11: 0.00357596170111
 +
P-value for T13: 0.000504346838529
  
 +
</pre>
 +
 +
This output was generated using the following python code:
 +
 +
<pre>
 +
import math, scipy.stats
 +
import numpy as np
 +
 +
mut_rate= 0.003 #Mutation Rate
 +
 +
n_2 = 10*37
 +
n_11 = 9*37
 +
n_13 = 10*12
 +
 +
k_2 = 23
 +
k_11 = 5
 +
k_13 = 4
 +
 +
def get_p_value(k, n, r):
 +
p_value  = 0.0
 +
for i in xrange(k, 38):
 +
binom = scipy.stats.binom.pmf(i,n,r)
 +
p_value = p_value + binom
 +
return p_value
 +
 +
print "P-value for T2: " + str(get_p_value(k_2, n_2, mut_rate))
 +
print "P-value for T11: " + str(get_p_value(k_11, n_11, mut_rate))
 +
print "P-value for T13: " + str(get_p_value(k_13, n_13, mut_rate))
 +
</pre>
  
 
<b> To Think About: </b>
 
<b> To Think About: </b>

Revision as of 22:12, 24 February 2014

To Calculate:

1. In slide 4, we used "posterior predictive p-value" to get the respective p-values 1.0e-13, .01, .12, and .0013. What if we had mistakenly just used the maximum likelihood estimate r=0.003, instead of integrating over r? What p-values would we have obtained? You can easily use python to calculate the p-value for each of the Townes using the PDF of a binomial distribution. Below are the p-values

P-value for T2: 7.82096716379e-23
P-value for T11: 0.00357596170111
P-value for T13: 0.000504346838529

This output was generated using the following python code:

import math, scipy.stats
import numpy as np

mut_rate= 0.003 #Mutation Rate

n_2 = 10*37 
n_11 = 9*37
n_13 = 10*12

k_2 = 23
k_11 = 5
k_13 = 4

def get_p_value(k, n, r): 
	p_value  = 0.0
	for i in xrange(k, 38):
		binom = scipy.stats.binom.pmf(i,n,r)
		p_value = p_value + binom
	return p_value
	
print "P-value for T2: " + str(get_p_value(k_2, n_2, mut_rate))
print "P-value for T11: " + str(get_p_value(k_11, n_11, mut_rate))
print "P-value for T13: " + str(get_p_value(k_13, n_13, mut_rate))

To Think About:

1. Can you think of a unified way to handle the Towne family problem (estimating r and deciding which family members are likely "non-paternal") without trimming the data? We'll show one such method in a later segment, but there is likely more than one possible good answer.

Class Activity

For the class activity on Monday February 24th, I was in group two. Our solutions can be found over at: Group Two: The Towne Family - Again, Class Activity

Back To: Eleisha Jackson