Tasks 07-06 - Contingency Tables & Bayes
Section 07: Probability & Statistics
Problem 1: Bayes’ Theorem Basics (x)
A medical test has the following characteristics: - Sensitivity: 90% (correctly identifies 90% of sick people) - Specificity: 95% (correctly identifies 95% of healthy people) - Prevalence: 5% (5% of the population has the disease)
- What is \(P(+|D)\)?
- What is \(P(-|D')\)?
- Calculate \(P(D|+)\) (PPV)
- Calculate \(P(D'|-)\) (NPV)
Problem 2: Contingency Table Construction (xx)
A company surveyed 200 employees about their commute method and job satisfaction: - 55% commute by car - 40% are highly satisfied - 30% commute by car AND are highly satisfied
- Construct a complete contingency table
- Find \(P(\text{Car}|\text{Highly Satisfied})\)
- Find \(P(\text{Highly Satisfied}|\text{Car})\)
- Are commute method and satisfaction independent?
Problem 3: Medical Testing - Full Analysis (xx)
A screening test for a disease has: - Sensitivity = 85% - Specificity = 92% - The disease affects 3% of the population
- Create a contingency table for a population of 10,000
- Calculate PPV directly from the table
- Calculate NPV directly from the table
- If you test positive, how worried should you be? Interpret PPV.
Problem 4: Factory Quality (xx)
A factory has two machines: - Machine A produces 70% of output, 4% defect rate - Machine B produces 30% of output, 6% defect rate
- What is the overall defect rate?
- A defective item is found. What’s the probability it came from Machine A?
- Create a contingency table for 1000 items
- Verify your answer to (b) using the table
Problem 5: Exam-Style Problem - 2025 Format (xxx)
In a city, a rapid test for a virus is available: - The test correctly identifies 92% of infected people (sensitivity) - The test correctly identifies 97% of non-infected people (specificity) - Currently 8% of the population is infected (prevalence)
A person tests positive.
Calculate the probability that this person is actually infected (PPV).
Now suppose the prevalence increases to 20% due to an outbreak. Recalculate PPV.
Explain why PPV changes with prevalence.
At what prevalence would PPV equal 80%? (Set up the equation and solve)
Problem 6: Exam-Style Problem - 2023 Format (xxx)
A company conducts employee surveys. Based on historical data: - 60% of employees are satisfied with their job - Of satisfied employees, 75% recommend the company to others - Of unsatisfied employees, 20% still recommend the company
- Create a contingency table for 500 employees
- What proportion of employees recommend the company?
- An employee recommends the company. What’s the probability they are satisfied?
- Are satisfaction and recommendation independent? Justify with calculations.