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?
Part 1: The probability of having the variant given a positive test result is 4.585%. This seems ridiculously low but technically the prevalence of MNR HIV-1 is so low that you’re more likely to be negative for MNR HIV-1 and have a false positive result than to actually be positive for MNR HIV-1. Assuming this test is only administered to people who are already positive for HIV, maybe this test should only be given based on the risk profile of the patient since the emergence of MNR HIV-1.
VP = .001*.96 #yes variant + positive test result
VN = .001*.04 #yes variant + negative test result
CP = .999*.02 #clear of variant + positive test result
CN = .999*.98 #clear of variant + negative test result
## [1] "Probability of having the variant and getting a positive result: 0.096%"
## [1] "Probability of having the variant and getting a negative result: 0.004%"
## [1] "Probability of NOT having the variant and getting a positive result: 1.998%"
## [1] "Probability of NOT having the variant and getting a negative result: 97.902%"
## [1] "Probability of a positive test result: 2.094%"
## [1] "Probability of having the variant given a positive test result: 4.585%"
Part 2: Let’s assume they retest any positive result and only provide variant-specifc treatment to the people who tested positive twice. Also assume the cost of the variant-specific treatment is provided as an annual figure. Then the cost of screening and treating 100,000 HIV patients for the variant in the first year is $102,094,000 for testing and $13,200,000 for treatments for a total cost of $115,294,000.
I think in the real world, given the outsized cost of testing over treatment, they would only test for MNR HIV-1 if they were exploring alternative treatments for a patient who is no longer responding to conventional treatment.
P = 100000 #population
V = P*.001 #expected number who have the variant
C = P*.999 #expected number who are clear of the variant
InitialPosTest = V*.96 + C*.02 #number of initial positive tests
ConfirmedPosTest = round(V*.96*.96, digits=0) + round(C*.02*.02, digits=0) #number of expected confirmed positive tests who will be treated
TTA = P + InitialPosTest #total tests administered
CostofTesting = TTA*1000
CostofTreatment = ConfirmedPosTest*100000
TotalCost = CostofTesting + CostofTreatment
format(TotalCost, big.mark=",", scientific=FALSE)
## [1] "115,294,000"
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?
#first principals
sprintf("%1.2f%%", 100*ncol(combn(24,2))*.05^2*.95^22)
## [1] "22.32%"
#R function
dbinom(2, size=24, prob=.05)
## [1] 0.2232381
What is the probability that, after 24 months, you received 2 or more inspections?
#first principals
1 - ncol(combn(24,0))*.05^0*.95^24 - ncol(combn(24,1))*.05^1*.95^23
## [1] 0.3391827
#r function
1 - dbinom(0,24,.05) - dbinom(1,24,.05)
## [1] 0.3391827
What is the probability that you received fewer than 2 inspections?
dbinom(0,24,.05) + dbinom(1,24,.05)
## [1] 0.6608173
What is the expected number of inspections you should have received?
# mean = n*p
24*.05
## [1] 1.2
What is the standard deviation?
# std = sqrt(n*p*(1-p))
sqrt(24*.05*.95)
## [1] 1.067708
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?
#first principals
10^3*exp(-10)/factorial(3)
## [1] 0.007566655
#R function
dpois(3,10)
## [1] 0.007566655
What is the probability that more than 10 arrive in one hour?
1-ppois(10,10)
## [1] 0.4169602
How many would you expect to arrive in 8 hours?
#10 per hour for 8 hours
10*8
## [1] 80
What is the standard deviation of the appropriate probability distribution?
#The standard deviation of a poisson distribution is the squareroot of the mean
sqrt(10*8)
## [1] 8.944272
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?
#If the three doctors can see 72 patients in 8 hours and you expect to get 80 patients in 8 hours then only 90% of patients are seen. Doctors are at 100% utilization of their time and still patients are unseen. Hire a fourth doctor - avoid practitioner burnout and reduce patient wait times to handle surges of patients.
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?
#Hypergeometric is the Binomial Distribution without replacement
N = 30 #total population
K = 15 #number of nurses
n = 6 #number selected
k = 5 #number of nurses selected
ncol(combn(15,5))*ncol(combn(15,1))/ncol(combn(30,6))
## [1] 0.07586207
#using R instead of first principals
dhyper(5,15,15,6)
## [1] 0.07586207
How many nurses would we have expected your subordinate to send?
6 * 15/30
## [1] 3
How many non-nurses would we have expected your subordinate to send?
6 * 15/30
## [1] 3
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?
#Geometric distributions are for the number of failures (safe driving) before the first success (car crash resulting in serious injury)
prob = 0
for (x in 1:1200)
{
prob = prob + .999^(x-1)*.001
}
prob
## [1] 0.6989866
#R is simpler
pgeom(1199,.001)
## [1] 0.6989866
In the course of 15 months?
#At 100 hours a month, 15 months is 1500 hours
pgeom(1499,.001)
## [1] 0.7770372
What is the expected number of hours that a driver will drive before being seriously injured?
1/.001
## [1] 1000
Given that a driver has driven 1200 hours, what is the probability that he or she will be injured in the next 100 hours?
pgeom(99,.001)
## [1] 0.09520785
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?
#I have to do it two different ways so I feel comfortable I'm using the functions correctly.
1-dpois(0,1)-dpois(1,1)-dpois(2,1)
## [1] 0.0803014
#and we match
1-ppois(2,1)
## [1] 0.0803014
What is the expected value?
#For a poisson distribution the mean is lambda, which here is 1
#Note we picked the poisson and not the binomial distribution because the failure of the generator could happen at any time, time being continuous, whereas the binomial distribution is for discrete events. An example with discrete events for binomial would be everytime you turn on the generator there's a 1% chance you get electrocuted and you have to turn it on 100 times a year.
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?
#two thirds of the time the patient will wait more than 10 minutes
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?
# three quarters of the patients who waited 10 minutes to be seen will wait at least another 5 minutes.
What is the expected waiting time?
#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?
#10 years
What is the standard deviation?
#mean = std for exponential distributions
#10 years
What is the probability that your MRI will fail after 8 years?
#average failure is after 10 years
#the decay parameter, m, is 1/average
#pdf is m*e^(-mx) where x is the time unit elapsed
#cdf is 1-e^(-mx)
1-(1-exp(-.1*8))
## [1] 0.449329
#Now in R
1-pexp(8,.1)
## [1] 0.449329
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?
#The exponential distribution is memoryless
1-exp(-.1*2)
## [1] 0.1812692
#Now in R
pexp(2,.1)
## [1] 0.1812692