Covid, False Positives & Bayesian Probability

This is a repost from 2009. It talks about breast cancer, but applies equally well to Covid testing, given the high percentage of false positives (not to mention the more worrisome false negatives). We simply are not wired well for probability…

Yudkowsky poses the following canonical problem:

1% of women at age forty who participate in routine screening have breast cancer. 80% of women with breast cancer will get positive mammographies. 9.6% of women without breast cancer will also get positive mammographies.

A woman in this age group had a positive mammography in a routine screening. What is the probability that she actually has breast cancer?

The frightening thing is that only 15% of doctors get this right. And they’re off by a lot. That is, the average answer is in the range of 80% while the correct answer is 7.8%.  Apparently, there is something about the way we think about the problem that makes 7.8% hard to accept, and Yudkowsky does a great job of walking you through the logic in painfully small steps.

Let’s try something similar here…

What Do We Know & What Does It Imply?

We have three pieces of information:

1% of sample are TRUE  (that is, they have cancer)

80% of sample who are TRUE will test TRUE

9.6% of sample who are FALSE will test TRUE.

On the face of it, we should guess that the percentage of women who test TRUE who actually are TRUE (test positive and actually have cancer)  is pretty small based on two facts provided: the actual percentage of women from the sample who are TRUE (regardless of testing) is only 1%, and the test has a false positive for 9.6% of those tested.

So, to solve this:

1) Assume we have a sample of 1000 women (I use 1000 to reduce the amount I have to talk about fractional people, but I don’t use 10,000 as I get lost in the zeros).

2) We know that the reality is that of the 1,000 women, 10 will have cancer (1%).

990 = no cancer
10 = cancer

3) Of the 10 who have cancer, 8 will test positive
8 out 1000 women tested will test True and are True

4) Of the 990 with no cancer 9.6% will also test positive = 990 * .096 = 95.04.
95.04 women out of 1,000 will test True but are False.

5) The total number testing true is 8 + 95.04 = 103.04.
Of these, 8 actually have Cancer.

6) So the value for tests positive (103.04) versus is positive (8) is 8/103.4 or 0.773  or 7.8%

Posted in Essentials | Comments Off on Covid, False Positives & Bayesian Probability

New site for my writing

I’ve created a site for my non-technical writing. Check it out.

Posted in Essentials | Comments Off on New site for my writing

.NET Maui!!!

Check out this lineup of guests

What can I say… an hour of amazing Maui goodness, including:

  • What is Maui?
  • When is Maui?
  • How does it affect Xamarin.Forms?

Posted in Maui, Xamarin.Forms | Tagged | Comments Off on .NET Maui!!!

MonkeyCache step by step

The amazing James Montemagno of Xamarin/Microsoft has done it again. He has created an incredibly simple cache, named MonkeyCache, that you can get up and running very quickly.

In this post I will walk through setting up and using the cache, step by step.

Continue reading
Posted in Essentials | Tagged , | Comments Off on MonkeyCache step by step

DataTemplateSelector

Suppose you have a collection of items and you want to display them in a ListView (Xamarin.Forms). The catch is that you want to change the display of each item depending on its state or some other code-based attributes.

At first glance this would seem very difficult, and you’d have to modify the instances in the collection to do so. This is where the DataTemplateSelector comes in.

In short, you create two or more data templates — one for each way you might want to display one of the items in your collection — and then you tell Xamarin.Forms, by way of the DataTemplateSelector, which data template to use.

Continue reading
Posted in Essentials, Xamarin.Forms | Comments Off on DataTemplateSelector

Jon Galloway: VS Mac & More

Jon Galloway. Friend of the show, PM on Visual Studio Mac, amazing guy.

Links:https://visualstudio.microsoft.com/vs/mac/
https://dotnet.microsoft.com/platform/community/standup
https://twitch.tv/jongalloway
https://github.com/SteveSandersonMS/CarChecker

Posted in Mac, Visual Studio, Xamarin.Forms | Tagged | Comments Off on Jon Galloway: VS Mac & More

C# 9 Part 3 – Patterns

Jared Parsons – lead of the C# Compiler Team at Microsoft

Posted in C#, Essentials | Tagged | Comments Off on C# 9 Part 3 – Patterns

C# 9 – Part 2

Jared Parsons – lead of the C# Compiler Team at Microsoft

Posted in C# | Tagged | Comments Off on C# 9 – Part 2

An Alert From the ViewModel

Quite often we want to send an alert from the view model, but you can only do so from the view. We’ve tackled this problem in the past but we think there is room for a simplified and clear step by step explanation.

Continue reading
Posted in Essentials | Tagged , | Comments Off on An Alert From the ViewModel

Code Snippet – By request

Code Snippets can save you from repetitive (boring) tasks. Visual Studio comes with a great many code snippets, perhaps the most often used is ctor which creates an empty constructor.

You can also create your own. Here is one I use a lot. It creates something that looks like this:

Continue reading
Posted in Essentials | Tagged | Comments Off on Code Snippet – By request

Latest Video: Xamarin.Forms

Proud to announce my newest video course: Hands On Xamarin.Forms. Learn Xamarin in 2.5 hours.

Posted in Xamarin, Xamarin.Forms | Tagged , | Comments Off on Latest Video: Xamarin.Forms

What’s Coming in C# 9 Part 1

Jared Parsons – lead of the C# Compiler Team at Microsoft

Posted in C# | Tagged | Comments Off on What’s Coming in C# 9 Part 1