SACHELP

Problem 7.80 A rare disease occurs in about 1 out of 1000 people who are similar to you. A test for the disease has sensitivity of 95% and specificity of 90%.
a Create a hypothetical one hundred thousand table illustrating this situation, where the row categories are disease(yes, no), and the column categories are test results (+/-). Sensitivity: True + Specificity: True - We know we have a 2- way table. We know the total is 100,000.

##       Positive Negative Total   
## Yes   "    NA" "    NA" "    NA"
## No    "    NA" "    NA" "    NA"
## Total "    NA" "    NA" "100000"

We know 1/1000 = 100/100000 will be diseased..

##       Positive Negative Total   
## Yes   "    NA" "    NA" "   100"
## No    "    NA" "    NA" "    NA"
## Total "    NA" "    NA" "100000"

We know Sensitivity = .95. The True +'s, or the proportion of those who are diseased is 95%.. or 95/100.

##       Positive Negative Total   
## Yes   "    95" "    NA" "   100"
## No    "    NA" "    NA" "    NA"
## Total "    NA" "    NA" "100000"

So 95 + something = 100.. clearly that something must be 5.

##       Positive Negative Total   
## Yes   "    95" "     5" "   100"
## No    "    NA" "    NA" "    NA"
## Total "    NA" "    NA" "100000"

100 + something = 100000. That something must be 99,900.

##       Positive Negative Total   
## Yes   "    95" "     5" "   100"
## No    "    NA" "    NA" " 99900"
## Total "    NA" "    NA" "100000"

So those 99,990 are all those without the disease. So we know Specificity = .90 = True -'s. Or the % of those who are correctly given a negative test result given they do not have the disease.
So .9*99900 = 89910

##       Positive Negative Total   
## Yes   "    95" "     5" "   100"
## No    "    NA" " 89910" " 99900"
## Total "    NA" "    NA" "100000"

So again we know that something+89910=99900. That something must be 9990.

##       Positive Negative Total   
## Yes   "    95" "     5" "   100"
## No    "  9990" " 89910" " 99900"
## Total "    NA" "    NA" "100000"

So we can fill out the remaining column sums..

##       Positive Negative Total   
## Yes   "    95" "     5" "   100"
## No    "  9990" " 89910" " 99900"
## Total " 10085" " 89915" "100000"
## Loading required package: lattice

plot of chunk unnamed-chunk-9