# College Math Teaching

## July 12, 2013

### An example to apply Bayes’ Theorem and multivariable calculus

I’ve thought a bit about the breast cancer research results and found a nice “application” exercise that might help teach students about Bayes Theorem, two-variable maximizing, critical points, differentials and the like.

I’ve been interested in the mathematics and statistics of the breast cancer screening issue mostly because it provided a real-life application of statistics and Bayes’ Theorem.

So right now, for women between 40-49, traditional mammograms are about 80 percent accurate in the sense that, if a woman who really has breast cancer gets a mammogram, the test will catch it about 80 percent of the time. The false positive rate is about 8 percent in that: if 100 women who do NOT have breast cancer get a mammogram, 8 of the mammograms will register a “positive”.
Since the breast cancer rate for women in this age group is about 1.4 percent, there will be many more false positives than true positives; in fact a woman in this age group who gets a “positive” first mammogram has about a 16 percent chance of actually having breast cancer. I talk about these issues here.

So, suppose you desire a “more accurate test” for breast cancer. The question is this: what do you mean by “more accurate”?

1. If “more accurate” means “giving the right answer more often”, then that is pretty easy to do.
Current testing is going to be wrong: if C means cancer, N means “doesn’t have cancer”, P means “positive test” and M means “negative test”, then the probability of being wrong is: $P(M|C)P(C) + P(P|N)P(N) = .2(.014) + .08(.986) = .08168$. On the other hand, if you just declared EVERYONE to be “cancer free”, you’d be wrong only 1.4 percent of the time! So clearly that does not work; the “false negative” rate is 100 percent, though the “false positive” rate is 0.

On the other hand if you just told everyone “you have it”, then you’d be wrong 98.6 percent of the time, but you’d have zero “false negatives”.

So being right more often isn’t what you want to maximize, and trying to minimize the false positives or the false negatives doesn’t work either.

2. So what about “detecting more of the cancer that is there”? Well, that is where this article comes in. Switching to digital mammograms does increase detection rate but also increases the number of false positives:

The authors note that for every 10,000 women 40 to 49 who are given digital mammograms, two more cases of cancer will be identified for every 170 additional false-positive examinations.

So, what one sees is that if a woman gets a positive reading, she now has an 11 percent of actually having breast cancer, though a few more cancers would be detected.

Is this progress?

My whole point: saying one test is “more accurate” than another test isn’t well defined, especially in a situation where one is trying to detect something that is relatively rare.
Here is one way to look at it: let the probability of breast cancer be $a$, the probability of detection of a cancer be given by $x$ and the probability of a false positive be given by $y$. Then the probability of a person actually having breast cancer, given a positive test is given by: $B(x,y) =\frac{ax}{ax + (1-a)y}$; this gives us something to optimize. The partial derivatives are: $\frac{\partial B}{\partial x}= \frac{(a)(1-a)y}{(ax+ (1-a)y)^2},\frac{\partial B}{\partial y}=\frac{(-a)(1-a)x}{(ax+ (1-a)y)^2}$. Note that $1-a$ is positive since $a$ is less than 1 (in fact, it is small). We also know that the critical point $x = y =0$ is a bit of a “duh”: find a single test that gives no false positives and no false negatives. This also shows us that our predictions will be better if $y$ goes down (fewer false positives) and if $x$ goes up (fewer false negatives). None of that is a surprise.

But of interest is in the amount of change. The denominators of each partial derivative are identical. The coefficients of the numerators are of the same magnitude; there are different signs. So the rate of improvement of the predictive value is dependent on the relative magnitudes of $x$, which is $.8$ for us, and $y$, which is $.08$. Note that $x$ is much larger than $y$ and $x$ occurs in the numerator $\frac{\partial B}{\partial y}$. Hence an increase in the accuracy of the $y$ factor (a decrease in the false positive rate) will have a greater effect on the accuracy of the test than a similar increase in the “false negative” accuracy.
Using the concept of differentials, we expect a change $\Delta x = .01$ leads to an improvement of about .00136 (substitute $x = .8, y = .08$ into the expression for $\frac{\partial B}{\partial x}$ and multiply by $.01$. Similarly an improvement (decrease) of $\Delta y = -.01$ leads to an improvement of .013609.

You can “verify” this by playing with some numbers:

Current ( $x = .8, y = .08$) we get $B = .1243$. Now let’s change: $x = .81, y = .08$ leads to $B = .125693$
Now change: $x = .8, y = .07$ we get $B = .139616$

Bottom line: the best way to increase the predictive value of the test is to reduce the number of false positives, while staying the same (or improving) the percentage of “false negatives”. As things sit, the false positive rate is the bigger factor affecting predictive value.