In statistical computations, intuition can be very misleading
Infected Script
Listing 2 simulates the experiment in Perl. In an array of 1,000 women whose health status is initially set in line 12 to 0
(i.e., "no findings"), the infect()
function in line 50 randomly introduces eight 1
s, thus simulating the 0.8 percent of women with breast cancer in the population. To allow this to happen, line 55 uses the shuffle()
function from the CPAN Algorithm::Numerical::Shuffle module to shuffle an array with the element index numbers of the patients' array based on the Fisher-Yates method [6]. Then, it selects a total of eight indices. At these points, the function then modifies the patient's array.
Listing 2
base-rate
The experiment performs the while
loop in line 16 until the "mammography" has returned 100,000 positive results, each initiated with the examine()
function in lines 34-47 with the previously known health status of the patient (for test purposes). The diagnosis takes errors of the first kind (10 percent) and the second kind (7 percent) into consideration. In case of positive findings, the function returns a true value to the main program and for negative findings, a false value. The results after calling the script are in line with the previous mathematical projections:
$ ./base-rate Test score: 9.26%
The Perl script confirms that a test with a significant false positive rate on a group of people with a small ratio of true positive findings is inherently unreliable. Instead of giving test results more credit than they're worth, in this case, it might be advisable to seek a second opinion instead.
Infos
- Ludo: https://en.wikipedia.org/wiki/Ludo_(board_game)
- p-Value: https://en.wikipedia.org/wiki/P-value
- Reinhart, Alex. Statistics Done Wrong: The Woefully Complete Guide. No Starch Press, 2015.
- Listings for this article: ftp://ftp.linux-magazine.com/pub/listings/magazine/178
- Base rate fallacy: https://en.wikipedia.org/wiki/Base_rate_fallacy
- Fisher-Yates shuffle: https://en.wikipedia.org/wiki/Fisher--Yates_shuffle
« Previous 1 2 3
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.
-
VirtualBox 7.1.4 Includes Initial Support for Linux kernel 6.12
The latest version of VirtualBox has arrived and it not only adds initial support for kernel 6.12 but another feature that will make using the virtual machine tool much easier.
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.