Question
1. A laboratory blood test is 95% effective in detecting a certain disease when it is, in fact, present. However, the test also yields a
1. A laboratory blood test is 95% effective in detecting a certain disease when it is, in fact, present. However, the test also yields a false positive result for 1% of the healthy people tested. (That is, if a healthy person is tested, then, with probability 0.01, the test will imply he or she has the disease.) If 0.5% of the population actually has the disease, what is the probability that a person has the disease given that the test result is positive?
a) Write a function that gives the probability of interest for any given rates of false positive, effectiveness and disease prevalence. Test your function to make sure that you get the correct probability as we calculated in class, i.e., 0.32.
b) Use the function in part (a) to plot the probability of interest at prevalence levels 00.5, with the step size of 0.001. Use the command plot and draw a line by setting type="l". What can you say about the probability of interest at different prevalence levels? Comment on your observation.
c) Now use the function in part (a) to obtain the probability when: (1) The effectiveness is 97.5% (i.e., its original 5% error rate is reduced by 50%), (2) The false positive rate is reduced by 50% to 0.5%, at prevalence levels 00.5, with the step size of 0.001. Add two new lines with different colors to the plot in part (b) corresponding to these new sets of probabilities. To do so, you can use the command lines. Color line (1) in red and color line (2) in blue. Which approach in part (c) is more effective in improving the probability of interest for a low prevalence disease, (1) or (2)?
2. Consider the below problem. In a shipment of N television sets, b are defective. A hotel makes a random purchase of size c from this shipment. Let X denote the number of defective sets purchased by the hotel.
a) Write a generic function in R that can calculate the probability that the hotel receives exactly x defective sets, for any number of good television sets, a, any number of defective television sets, b, and any number of sets that the hotel purchases, c. Note that a + b = N.
b) Use the function from part (a) to calculate the probability when a = 5, b = 2, c = 3, for X = 1. (The function needs to return 4/7 = 0.5714286.)
c) Identify the type of the random variable and use an appropriate built-in function in R to obtain the probability when a = 5, b = 2, c = 3, for X = 1.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started