Select your font size 
 
about us products & services consulting & support news & events contact us
Paul Meagher explains the meaning of a positive cancer test result, and in so doing he shows how to calculate conditional probability.

Learning from experience - New Brunswick

print this article 
 

To appreciate how the getConditionalProbabiltity function might be used in practice, consider a doctor confronted with the problem of determining whether a patient has cancer given that the patient tested positive on some cancer test. The test could be something as simple as a "yes" or "no" answer to a question (such as, were you ever exposed to high levels of radiation?) or it could be the result of a physical examination of the patient.

To compute the conditional probability of cancer given a positive test result, the doctor might tally the number of past cases where cancer and a positive test result occurred together and divide by the overall number of positive test results. The following code computes this probability based on a total of four past cases where this co-variation information was collected -- perhaps from the doctor's personal experiences with this particular cancer test.

Listing 2. Computing a conditional probability using getConditionalProbabiltity

<?php 
require "getConditionalProbability.php"; 

/** 
* The elements of the $Data array use this coding convention: 
* +cancer - patient has cancer 
* -cancer - patient does not have cancer 
* +test - patient tested positive on cancer test 
* -test - patient tested negative on cancer test 
**/ 

$Data[0] = array("+cancer", "+test"); 
$Data[1] = array("-cancer", "-test"); 
$Data[2] = array("+cancer", "+test"); 
$Data[3] = array("-cancer", "+test");

// specify query variable $A and conditioning variable $B 
$A = "+cancer"; $B = "+test"; 

// compute the conditional probability of having cancer given 1) 
// a positive test and 2) a sample of covariation data 
$probability = getConditionalProbabilty($A, $B, $Data); 
echo "P($A|$B) = $probability"; 
// P(+cancer|+test) = 0.66666666666667 

?>

As you can see, the probability of having cancer given:

  1. A positive test result
  2. The data collected to date

is estimated at 67 percent. In other words, in the next 100 cases where a patient tests positive, the best point estimate is that in 67 of those cases, the patient will actually have cancer. The doctor will need to weight this probability along with other information to arrive at a final diagnosis if one is warranted.

I can summarize what has been demonstrated here in more radical terms as follows:

An agent that derives a conditional probability estimate using the enumeration method appears to learn from experience and will provide an optimal estimate of the true conditional probability if it has enough representative data to draw upon.

If I replace the hypothetical doctor with a software agent implementing the enumeration algorithm above and being fed a steady diet of the case data, I might expect the agent's conditional probability estimates to become increasingly more reliable and accurate. I might say that such an agent is capable of "learning from experience."

If this is so, perhaps I want to ask what the relationship is between this simple enumeration technique for computing a conditional probability and more legitimate examples of "learning from experience," such as the semi-automated classification of spam using Bayes methods. In the next section, I will show a simple spam filter can be constructed using the enumerative power of a database.



Page:   1  2  3  4  5  6  7  8  9  10  11 Next Page: Conditional probability and SQL

The content shown in this page was first published by IBM developerWorks and is reprinted with permission from Paul Meagher (www.datavore.com)


Most Recent Website and Regional Updates

 Research Tools
Measure human resource allocation and collect data with the goal of determining patterns that will bring forward actionable insights which may lead to policy changes, saving money and improving quality of service.

 
 Process Evaluation Questions
Questions to help focus discussion about process improvement

 
 Operations Research
Operations Research (frequently called OR), is the methodical study of how to do things better. It is also called Optimization Theory.

 
 Our Role in Operations Optimization
Meet objectives more efficiently by improving operational effectiveness and profitability.

 
 Monte Carlo Method
Short description of the Monte Carlo Method in optimization theory.

 
 Introduction to Markov Process
Introduction to Markov Chains and Markov Processes, with a link to an introductory PDF which provides essential details about Markov analysis, along with helpful examples and exercises.

 
 Windows PC Tech Support Price Calculator
Transparen offers first-class Windows PC and Linux PC tech support services based on a number of factors such as a count of supported desktops.

 
 Remote Technical Support
Remote technical support is provided 24/7 by Transparen's staff, not only for data recovery, but also for proactive maintenance (i.e. detecting problems early, before they become disasters).

 
 Monthly Price for Computer Support Service
Transparen's billing is predictable and affordable. Use our automated price calculator to find the monthly price for our tech support service.

 
 Advantages of Remote Desktop Support
1. You get more for less. 2. We can work when you're not using the computer. 3. Your staff will be more productive. 4. You avoid many expensive repair situations by fixing problems earlier. 5. 24/7 Support!

 
 21/11/2008: Somali Pirates
Earlier this week, a giant Saudi oil tanker became the largest vessel ever hijacked by pirates operating with near impunity off the coast of Somalia. Today on the Current podcast, we'll have an interview with the head of one of the pirate groups operating in the area.

 
 20/11/2008: Juice Box Investigation
How a tainted juice box led one family on a convoluted quest for answers about their children's health.

 
 19/11/2008: Intimidation by Pharmaceutical Companies
Doctors sometimes discover that the drugs they're prescribing can be more harmful to some of their patients than the diseases they treat. But as CBC Radio health reporter Pauline Dakin tells the Current, some doctors say they've been intimidated by pharmaceutical companies into keeping their suspicions and their research quiet.

 
 18/11/2008: The Ascent of Money: Niall Ferguson
Author Niall Ferguson forecasts our financial future by checking on the planet's moneyed history in his book, "The Ascent of Money: A Financial History of The World".

 
 17/11/2008: Shuja Nawaz on Pakistan
For more than half of its existence as an independent nation, Pakistan has been governed by its military. Author and journalist Shuja Nawaz dissects the Country's military history and provides a perspective on today's political reality.

 
 14/11/2008: Peter C. Newman on Izzy Asper
A bold and brassy Prairie man named Izzy created Canada's third national T.V. network. Now, as CanWest Global sheds jobs and cash, we're stepping back, and remembering the life and times of Israel Asper.

 
 13/11/2008: The Full Interview with Mellissa Fung
Yesterday, Anna Maria spoke with Mellissa Fung, a CBC journalist who was held captive for a month in Afghanistan. This is the only interview Mellissa Fung will do. Today on the Current podcast, their full conversation.

 
 12/11/2008: Avichay Sharon
A former Israeli soldier breaks the silence on what, he says, really happens when the army raids a village in the occupied territories.

 

Google
 
Web transparen.com

Contact Information

Related Information

 
   
 
E C M | © 2003-2007 Transparen Corp.      

Standardized Services: Data Recovery Service / Creative Services / Premium Web Hosting Services / System Administration Tech Support Services
Recent Projects: Full-Service Mortgage and Financing Company / System to manage flights from Vancouver to Tofino / Photo exchange verification service
Our Vancouver BC Server Proudly Hosts: automated parking and revenue control systems, leafside lane at southlands, cost effective alternative power sources, Higher Grade Learning Centres, pacific forage bag supply, sunburst medical, neosonic design, roger mahler photography - passionate, intriguing, desirable, the connection between east and west, affordable flights to victoria and tofino, low interest mortgage brokers in vancouver, richmond, surrey, toronto, Toronto Calgary and Vancouver IT staffing and talent search
* Alma * Aroostook * Atholville * Baker Brook * Balmoral * Bas Caraquet * Bath * Bathurst * Belledune * Beresford * Bertrand * Blacks Harbour * Blackville * Bouctouche * Bristol * Cambridge-Narrows * Campbellton * Canterbury * Cap Pélé * Caraquet * Centreville * Charlo * Chipman * Clair * Dalhousie * Dieppe * Doaktown * Dorchester * Drummond * Edmundston * Eel River Crossing * Florenceville * Fredericton * Fredericton Junction * Gagetown * Grand Bay-Westfield * Grand Falls * Grand Manan * Grande-Anse * Hampton * Hartland * Harvey * Hillsborough * Kedgwick * Lac Baker * Lameque * Le Goulet * Maisonnette * McAdam * Meductic * Memramcook * Millville * Minto * Miramichi * Moncton * Nackawic * Neguac * New Maryland * Nigadoo * Norton * Oromocto * Paquetville * Perth-Andover * Petitcodiac * Petit Rocher * Plaster Rock * Pointe-Verte * Port Elgin * Quispamsis * Rexton * Richibucto * Riverside-Albert * Riverview * Riviere-Verte * Rogersville * Rothesay * Sackville * Saint-Andre * Saint-Antoine * Saint-François-de-Madawaska * Saint-Hilaire * Saint-Isidore * Saint John * Saint-Leolin * Saint-Leonard * Saint-Louis-de-Kent * Saint-Quentin * Sainte-Anne-de-Madawaska * Sainte-Marie - Sainte-Raphael * Salisbury * Shediac * Shippagan * Stanley * St. Andrews * St. George * St. Martins * St. Stephen * Sussex * Sussex Corner * Tide Head * Tracadie-Sheila * Tracy * Woodstock * Aberdeen * Aboujagane * Acadie * Acadie Siding * Acadieville * Adams Gulch * Adamsville * Addington * Albert Mines * Albrights Corner * Alcida * Alderwood * Aldouane * Allainville * Allardville * Allison * Ammon * Anagance * Anderson Road * Anderson Settlement * Andersonville * Anfield * Anse-Bleue * Apohaqui * Arbeau Settlement * Armond * Arthurette * Ashland * Astle * Aulac * Avondale * Back Bay * Baie-Ste-Anne * Baie Verte * Barryville * Bartibog Bridge * Bates Settlement * Bay du Vin * Bayside * Beaubassin East * Beaverbrook * Beaver Dam * Bellefleur * Benjamin River * Berwick * Bettsburg * Big Hole * Big River * Black River * Black River Bridge * Blair Athol * Blissfield * Blissville * Bloomfield * Bloomfield Ridge * Boiestown * Bocabec * Brantville * Brockway * Browns Flat * Bull Lake * Burnsville * Burnt Church * Burton * Burtts Corner * Cains River * Campbell Settlement * Campobello Island * Canton des Basques * Caron Brook * Carrolls Crossing * Casillis * Caverhill * Chamcook * Chatham * Chatham Head * Chelmsford * Clarkville * Cloverdale * Cocagne * Coles Island * Collette * Connors * Cornhill * Coteau Road * Dalhousie Junction * Daulnay * Dawsonville * Debec * Deer Island * Derby * Devereaux * Douglas * Douglastown * Dugas * Duguayville * Dumfries * Dundee * Dunlop * Durham Bridge * Eel Ground * Elgin * Escuminac * Evandale * Évangéline * Fairisle * Fairvale * Five Fingers * Flatlands * Four Falls * Gauvreau * Geary * Glassville * Glencoe * Glen Levit * Glenwood * Gondola Point * Grafton * Grande-Digue * Gravel Hill * Gray Rapids * Hainesville * Hampstead * Hanwell * Hardwicke * Hartfield * Hatfield Point * Haut-Lamèque * Haut-Sheila * Havelock * Hawkshaw * Hazeldean * Head of Millstream * Health Steele * Hebron * Honeydale * Howard * Hoyt * Inkerman * Jacquet River * Janeville * Jemseg * Johnsville * Juniper * Keswick Ridge * Kingsclear * Kingston * Kouchibouguac * Lagacéville * Lake George * Lakeville * LaPlante * Lavillette * Lawrence Station * Limestone * Loggieville * Lorne * Losier Settlement * Lower Newcastle * Ludlow * Mactaquac * Madran * Magaguadavic Settlement * Magundy * Maltampec * Maple Ridge * Marysville * Maugerville * McGivney * McGraw Brook * McLeods * McNamee * Menneval * Millerton * Miramichi Bay * Miscou Island * Moulin-Morneault * Napadogan * Napan * Nash Creek * Nashwaak Bridge * Nashwaak Village * Nasonworth * Nauwigewauk * Nelson * Nelson Hollow * New Bandon * New Denmark * New Jersey * New Mills * Nicolas-Denys * Noonan * Nordin * North Head * North Tetagouche * Northampton * Notre-Dame * Notre-Dame-de-Lourdes * Notre-Dame-des-Érables * Oak Bay * Odell * Otis * Oxbow * Pabineau Falls * Parker Ridge * Pembroke * Penniac * Penobsquis * Petite-Lamèque * Petite-Rivière-de-l'Ile * Petite-Tracadie * Pigeon Hill * Pinder * Pocologan * Point La Nim * Pointe-à-Bouleau * Pointe-Alexandre * Pointe-Canot * Pointe-Sapin * Pokemouche * Pokeshaw * Pokesudie * Pokiok * Pont-Lafrance * Pont-Landry * Porten * Priceville * Prince William * Quarryville * Queensbury * Quisbis * Red Bank * Renforth * Renous * Richibouctou-Village * Riley Brook * Ripples * Riviere-du-Portage * Robertville * Robinsonville * Rosaireville * Rossville * Rough Waters * Saint-Arthur * Saint-Basile * Saint-Charles * Saint-Ignace * Saint-Irenée * Saint-Jacques * Saint-Jean-Baptiste-de-Restigouche * Saint-Joseph-de-Madawaska * Saint-Laurent * Saint-Martin-de-Restigouche * Saint-Maure * Saint-Sauveur * Saint-Simon * Sainte-Louise * Sainte-Marie-de-Kent * Sainte-Rose * Salmon Beach * Saumarez * Scotch Lake * Seal Cove * Sevogle * Shannonvale * Sheffield * Shemogue * Siegas * Sillikers * Sisson Ridge * Southampton * South Tetagouche * Springfield * Squaw Cap * St. Margarets * Stickney * Strathadam * Stonehaven * Sunny Corner * Tabusintac * Targettville * Taxis River * Taymouth * Temperance Vale * Tetagouche Falls * Tilley * Tracadie Beach * Tremblay * Upper Blackville * Upper Kent * Upper Queensbury * Upsalquitch * Val-Comeau * Val-d'Amour * Val-Doucet * Verret * Village-Blanchard * Village-Saint-Laurent * Waterville * Wayerton * Weaver Siding * Welsford * Westfield * White Rapids * Whites Cove * Wicklow * Williamstown * Wilsons Beach * Wirral * Zealand * Aberdeen * Acadieville * Addington * Allardville * Alma * Alnwick * Andover * Baker Brook * Balmoral * Bathurst * Beresford * Blackville * Blissfield * Blissville * Botsford * Bright * Brighton * Brunswick * Burton * Cambridge * Campobello * Canning * Canterbury * Caraquet * Cardwell * Carleton * Chatham * Chipman * Clair * Clarendon * Colborne * Coverdale * Dalhousie * Denmark * Derby * Dorchester * Douglas * Drummond * Dufferin * Dumbarton * Dumfries * Dundas * Durham * Eldon * Elgin * Gagetown * Gladstone * Glenelg * Gordon * Grand Falls * Grand Manan * Greenwich * Grimmer * Hammond * Hampstead * Hampton * Harcourt * Hardwicke * Harvey * Havelock * Hillsborough * Hopewell * Huskisson * Inkerman * Johnston * Kars * Kent * Kingsclear * Kingston * Lac-Baker * Lepreau * Lincoln * Lorne * Ludlow * Madawaska * Manners Sutton * Maugerville * McAdam * Moncton * Musquash * Nelson * New Bandon * New Maryland * Newcastle * North Lake * Northampton * Northesk * Northfield * Norton * Notre-Dame-de-Loudres * Paquetville * Peel * Pennfield * Perth * Petersville * Prince William * Queensbury * Richibucto * Richmond * Rivière-Verte * Rogersville * Rothesay * Sackville * Saint Andrews * Saint Croix * Saint David * Saint George * Saint James * Saint Martins * Saint Mary * Saint Marys * Saint Patrick * Saint Stephen * Saint-André * Saint-Basile * Saint-Charles * Saint-François * Saint-Hiliare * Saint-Isidore * Saint-Jacques * Saint-Joseph * Saint-Louis * Saint-Léonard * Saint-Paul * Saint-Quentin * Sainte-Anne * Salisbury * Saumarez * Shediac * Sheffield * Shippagan * Simonds, Carleton County * Simonds, Saint John County * Southampton * Southesk * Springfield * Stanley * Studholm * Sussex * Upham * Wakefield * Waterborough * Waterford * Weldford * Wellington * West Isles * Westfield * Westmorland * Wickham * Wicklow * Wilmot * Woodstock