A new test for multinucleoside-resistant (MNR) human immunodeficiency virus type 1 (HIV-1) variants was recently developed. The test maintains 96% sensitivity, meaning that, for those with the disease, it will correctly report “positive” for 96% of them. The test is also 98% specific, meaning that, for those without the disease, 98% will be correctly reported as “negative.” MNR HIV-1 is considered to be rare (albeit emerging), with about a .1% or .001 prevalence rate.
Given the prevalence rate, sensitivity, and specificity estimates, what is the probability that an individual who is reported as positive by the new test actually has the disease? If the median cost (consider this the best point estimate) is about $100,000 per positive case total and the test itself costs $1000 per administration, what is the total first-year cost for treating 100,000 individuals?
\[\begin{equation*} P(A|B) = P(B|A) * P(A) / P(B|A) * P(A) + P(B|not A) * P(not A) \end{equation*}\]
positive <- 0.96
negative <- 0.98
prevalence_rt <- .001
positive_prob <- positive * prevalence_rt /(positive * prevalence_rt + 0.02 * 0.999)
print(paste0('The probability that an individual who is reported as positive by the new test actually has the disease is ', round(positive_prob*100,2),'%'))
## [1] "The probability that an individual who is reported as positive by the new test actually has the disease is 4.58%"
Med_treatment <- 100000
test_cost <- 1000
ttl_cases <- 100000
ttl_First_Year_Cost <- (test_cost * ttl_cases) + (Med_treatment * prevalence_rt) * Med_treatment
ttl_First_Year_Cost <- format(as.numeric(as.character(ttl_First_Year_Cost)), scientific = F)
print(paste0('The total first-year cost for treating 100,000 individuals is $', ttl_First_Year_Cost))
## [1] "The total first-year cost for treating 100,000 individuals is $110000000"
The probability of your organization receiving a Joint Commission inspection in any given month is .05. What is the probability that, after 24 months, you received exactly 2 inspections?
prob_insp <- .05
no_months <- 24
no_insp <- 2
prob_no_insp <- 1 - prob_insp
prob_2insp <- dbinom(no_insp, no_months, prob_insp)
print(paste0("The probability that, after 24 months, you received exactly 2 inspections is: ", round(prob_2insp*100,2),'%'))
## [1] "The probability that, after 24 months, you received exactly 2 inspections is: 22.32%"
What is the probability that, after 24 months, you received 2 or more inspections?
prob_2plusinsp <- 1 - (dbinom(1, no_months, prob_insp) + dbinom(0, no_months, prob_insp))
print(paste0("The probability that, after 24 months, you received 2 or more inspections is: ", round(prob_2plusinsp*100,2),'%'))
## [1] "The probability that, after 24 months, you received 2 or more inspections is: 33.92%"
What is the probability that your received fewer than 2 inspections?
prob_fewer2insp <- (dbinom(1, no_months, prob_insp) + dbinom(0, no_months, prob_insp))
print(paste0("The probability that, after 24 months, you received 2 or more inspections is: ", round(prob_fewer2insp*100,2),'%'))
## [1] "The probability that, after 24 months, you received 2 or more inspections is: 66.08%"
What is the expected number of inspections you should have received?
exp_no_insp <- no_months * prob_insp
print(paste0("The expected number of inspections to be received is ", round(exp_no_insp,0)))
## [1] "The expected number of inspections to be received is 1"
What is the standard deviation?
std_dev <- (no_months * prob_insp * prob_no_insp) ^ .5
print(paste0("The standard deviation is ", round(std_dev,2)))
## [1] "The standard deviation is 1.07"
You are modeling the family practice clinic and notice that patients arrive at a rate of 10 per hour. What is the probability that exactly 3 arrive in one hour?
arrival_rate <- 10
arrival_per_hr <- 3
prob_3 <- dpois(arrival_per_hr, arrival_rate)
print(paste0("The probability that exactly 3 patients arrive in one hour is ", round(prob_3 * 100, 2),'%'))
## [1] "The probability that exactly 3 patients arrive in one hour is 0.76%"
What is the probability that more than 10 arrive in one hour?
arrival_per_hr <- 10
prob_10 <- 1 - ppois(arrival_per_hr, arrival_rate)
print(paste0("The probability that exactly 3 patients arrive in one hour is ", round(prob_10 * 100, 2),'%'))
## [1] "The probability that exactly 3 patients arrive in one hour is 41.7%"
How many would you expect to arrive in 8 hours?
expected_8 <- arrival_rate * 8
print(paste0("I expect ", expected_8,' patients to arrive in 8 hours'))
## [1] "I expect 80 patients to arrive in 8 hours"
What is the standard deviation of the appropriate probability distribution?
stan_dv <- sqrt(arrival_rate)
print(paste0("The standard deviation of the appropriate probability distribution is ", round(stan_dv, 2)))
## [1] "The standard deviation of the appropriate probability distribution is 3.16"
If there are three family practice providers that can see 24 templated patients each day, what is the percent utilization and what are your recommendations?
ANSWER: My recomendation is to hire additional practice providers.
percen_util <- (80) / (3*24) * 100
print(paste0("The percent utilization if there are three family practice providers that can see 24 templated patients each day is ", round(percen_util, 2),'%'))
## [1] "The percent utilization if there are three family practice providers that can see 24 templated patients each day is 111.11%"
Your subordinate with 30 supervisors was recently accused of favoring nurses. 15 of the subordinate’s workers are nurses and 15 are other than nurses. As evidence of malfeasance, the accuser stated that there were 6 company-paid trips to Disney World for which everyone was eligible. The supervisor sent 5 nurses and 1 non-nurse. If your subordinate acted innocently, what was the probability he/she would have selected five nurses for the trips?
total_sub <- 30
sub_nurses <- 15
sub_non_nurse <- 15
total_comp_trp <- 6
nurses_sent <- 5
prob <- dhyper(nurses_sent, sub_non_nurse, sub_non_nurse, total_comp_trp)
print(paste0('The probability five nurses would be selected for the trip is: ', round(prob * 100,2),'%'))
## [1] "The probability five nurses would be selected for the trip is: 7.59%"
How many nurses would we have expected your subordinate to send?
exp_nurses <- total_comp_trp * (sub_nurses / total_sub)
print(paste0('I expect the subordinate to send ', exp_nurses, ' nurses.'))
## [1] "I expect the subordinate to send 3 nurses."
How many non-nurses would we have expected your subordinate to send?
exp_non_nurses <- total_comp_trp * (sub_non_nurse / total_sub)
print(paste0('I expect the subordinate to send ', exp_non_nurses, ' non-nurses.'))
## [1] "I expect the subordinate to send 3 non-nurses."
The probability of being seriously injured in a car crash in an unspecified location is about .1% per hour. A driver is required to traverse this area for 1200 hours in the course of a year. What is the probability that the driver will be seriously injured during the course of the year?
prob_inj <- pgeom(1200, .001)
print(paste0('The probability that the driver will be seriously injured during the course of the year is ', round(prob_inj * 100,2),'%'))
## [1] "The probability that the driver will be seriously injured during the course of the year is 69.93%"
In the course of 15 months?
prob_inj15 <- pgeom(1500, .001)
print(paste0('The probability that the driver will be seriously injured in the course of 15 months is ', round(prob_inj15 * 100,2),'%'))
## [1] "The probability that the driver will be seriously injured in the course of 15 months is 77.73%"
What is the expected number of hours that a driver will drive before being seriously injured?
exp_hrs <- 1 / .001
print(paste0('The expected number of hours that a driver will drive before being seriously injured is ', exp_hrs,' hrs'))
## [1] "The expected number of hours that a driver will drive before being seriously injured is 1000 hrs"
Given that a driver has driven 1200 hours, what is the probability that he or she will be injured in the next 100 hours?
prob_inj100 <- pgeom (1300,.001) - pgeom (1200,.001)
print(paste0('The probability that the driver will be injured in the next 100 hours is ', round(prob_inj100 * 100,2),'%'))
## [1] "The probability that the driver will be injured in the next 100 hours is 2.86%"
You are working in a hospital that is running off of a primary generator which fails about once in 1000 hours. What is the probability that the generator will fail more than twice in 1000 hours?
prob_fail <- 1-ppois(2,1)
print(paste0('The probability that the generator will fail more than twice in 1000 hours is ', round(prob_fail * 100,2),'%'))
## [1] "The probability that the generator will fail more than twice in 1000 hours is 8.03%"
What is the expected value? AMSWER: The expected value is stated as the number of times the generator is expected to fail which is once in every 1000 hours, which equates to 1
A surgical patient arrives for surgery precisely at a given time. Based on previous analysis (or a lack of knowledge assumption), you know that the waiting time is uniformly distributed from 0 to 30 minutes. What is the probability that this patient will wait more than 10 minutes?
prob_wait <- 1 - punif(10,0,30)
print(paste0('The probability that the patient will wait more than 10 minutes is ', round(prob_wait * 100,2),'%'))
## [1] "The probability that the patient will wait more than 10 minutes is 66.67%"
If the patient has already waited 10 minutes, what is the probability that he/she will wait at least another 5 minutes prior to being seen?
prob_wait5 <- 1 - punif(15, 10, 30)
print(paste0('The probability that the patient will wait at least another 5 minutes prior to being seen is ', round(prob_wait5 * 100,2),'%'))
## [1] "The probability that the patient will wait at least another 5 minutes prior to being seen is 75%"
What is the expected waiting time?
exp_wait <- (0 + 30) / 2
print(paste0('The expected wait tiime is ', exp_wait,' minutes.'))
## [1] "The expected wait tiime is 15 minutes."
Your hospital owns an old MRI, which has a manufacturer’s lifetime of about 10 years (expected value). Based on previous studies, we know that the failure of most MRIs obeys an exponential distribution. What is the expected failure time?
exp_fail <- 1 / 10
print(paste0('The expected failure time is ', round(exp_fail * 100,2),' years'))
## [1] "The expected failure time is 10 years"
What is the standard deviation?
stan_dv <- (sqrt(1/(10^2)))
print(paste0("The standard deviation of the appropriate probability distribution is ", round(stan_dv * 100, 2)))
## [1] "The standard deviation of the appropriate probability distribution is 10"
What is the probability that your MRI will fail after 8 years?
fail_after8 <- 1 - pexp(8, (1/10))
print(paste0('The probability that the MRI will fail after 8 years is ', round(fail_after8 * 100,2),'%'))
## [1] "The probability that the MRI will fail after 8 years is 44.93%"
Now assume that you have owned the machine for 8 years. Given that you already owned the machine 8 years, what is the probability that it will fail in the next two years?
fail_in2 <- pexp(2,(1/10))
print(paste0('The probability that the MRI machine will fail in the next two years is ', round(fail_in2 * 100,2),'%'))
## [1] "The probability that the MRI machine will fail in the next two years is 18.13%"