CoCalc Public Files2020-03-16-145402.ipynb
Author: Michelle Arroyo
Views : 63
Compute Environment: Ubuntu 18.04 (Deprecated)
In [1]:
#1
#           No CF                                   CF
#test +    99.9667 (9996.67 - 9896.7033)       2.89(3.333*0.87)
#test -    9896.7033 (0.99*9996.67)            0.433 (3.333-2.89)
#total     9996.67                             3.333 (1/3000*10000)
#Sensitivity is 87%
#Specificity is 99%
#USed 10000 as sample size

In [2]:
#1a
#2.89/(99.9667+2.89) = 2.809% of a newborn actually having CF is  that they have a blood test

#Positive predictive value: 0.87*0.003/ ((0.87*0.003 + (0.99*99.9996))) = 0.028999351469048962

#Prevalence = 1/3000

In [6]:
0.87*0.0003/ ((0.87*0.0003 + (0.99*99.9996)))

2.636367231409861e-06
In [7]:
#1b The test gives a high specificity which can ensure that the baby most likely doesn't have CF, if they really don't have it. The test ensures that it can detect CF before the condition worsens.Althought, the sensitivity is not as high, the test is used more to detect

In [10]:
#2a
#          No COVID                              COVID-19
#test +    939.99 (9999.99-9059.99)          0.887 (1*0.887)
#test -    9059.35 (0.906*9999.99)            0.113 (1-0.887)
#total     9999.99  (1-10000)                 1      (1/10000 *10000)
#Sensitivity is  88.7%
#Specificity is  90.6%
#Used 10000 as sample size

#0.887/(939.99+0.887) = 0.0942% who test positive
(0.887/(939.99+0.887))*100

0.09427374672778695
In [11]:
#2B
#Using the positive predictive value, we see that a person that tests positive and actually has the COVID-19 is a 0.094% chance. Compared to a person who actually has a fever and cough, we can predict that this patient has a higher chance of carrying the disease compared to the person that tested for COVID-19.


In [12]:
#2C
#          No COVID                              COVID-19
#test +    921.2 (9800-8878.8)          177.4 (200*0.887)
#test -    8878.8 (9800*0.906)            22.6 (200-177.4)
#total     9800  (200-10000)                 200      (1/50 *10000)
#Sensitivity is  88.7%
#Specificity is  90.6%
#Used 10000 as sample size

(177.4/(921.2+177.4))
#

0.1614782450391407
In [ ]:
#3
#                Model X                Model Y
# Allele B    26.4 ((0.66*40)/1)          3.3  ((0.33*10)/1)
# Allele D    39.6 ((0.66*60)/1)          29.7 ((0.33*90)/1)

#Prevalence of Model X is 66%
# prevalence of Model Y is 33%

#Observing the B allele, the new values of probability of Model X is 26.4 and Model Y is 3.3. The observed new values for the D allele in Model X is 39.6 and Model Y is 29.

In [ ]:


In [ ]:


In [ ]:

`