Hazal Gunduz
1. (Bayesian). 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?
sensitivity <- .96
specific <- .98
prevalenceRate <- .001
medianCost <- 100000
testCost <- 1000
pro <- (sensitivity * prevalenceRate) / ((sensitivity * prevalenceRate) + (1 - specific) * (1 - prevalenceRate))
pro
## [1] 0.04584527
individuals <- 100000
treatCost <- 100000
testCost <- 1000
prevalenceRate <- .001
noNeg <- .02
sensitivity <- .96
totalCost <- (individuals * noNeg) + (individuals * prevalenceRate * sensitivity)
firstyearCost <- (totalCost * treatCost) + (testCost * individuals)
firstyearCost
## [1] 309600000
2. (Binomial). 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? What is the probability that, after 24 months, you received 2 or more inspections? What is the probability that your received fewer than 2 inspections? What is the expected number of inspections you should have received? What is the standard deviation?
# after 24 months, for receiving exactly 2 inspections
dbinom(2, size = 24, prob = .05)
## [1] 0.2232381
# after 24 months, for receiving 2 or more inspections
pbinom(1, size = 24, prob = .05, lower.tail = F)
## [1] 0.3391827
# for receiving fewer than 2 inspections
pbinom(1, size = 24, prob = .05)
## [1] 0.6608173
# expected number of inspections
24 * .05
## [1] 1.2
# standard deviation
sd <- sqrt(.05 * .95 * 24)
sd
## [1] 1.067708
3. (Poisson). 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? What is the probability that more than 10 arrive in one hour? How many would you expect to arrive in 8 hours? What is the standard deviation of the appropriate probability distribution? 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?
# exactly 3 arrive in one hour
dpois(3, lambda = 10)
## [1] 0.007566655
# more than 10 arrive in one hour
ppois(10, lambda = 10, lower.tail = F)
## [1] 0.4169602
# Patient are expected in 8 hours
10 * 8
## [1] 80
# standard deviation of the appropriate probability
sd <- sqrt(10)
sd
## [1] 3.162278
# utilization
utilization <- 80 /(24 * 3)
utilization * 100
## [1] 111.1111
Recommendation: I would not recommend extending working hours because working beyond human capacity will result in decreased productivity. Instead, more family practice providers can be taken. Thus, both the quality of work is increased and the workforce is provided.
4. (Hypergeometric). 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? How many nurses would we have expected your subordinate to send? How many non-nurses would we have expected your subordinate to send?
# probability of 5 nurses were innocently selected.
dhyper(5, 15, 15, 6, .5)
## [1] 0.07586207
# expected nurses
6 * (15 / 30)
## [1] 3
# expected non-nurses
6 * .5
## [1] 3
5. (Geometric). 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? In the course of 15 months? What is the expected number of hours that a driver will drive before being seriously injured? Given that a driver has driven 1200 hours, what is the probability that he or she will be injured in the next 100 hours?
# probability of seriously injured in course of year
probInjury <- .001
pgeom(1200, .001)
## [1] 0.6992876
# probability of seriously injured in 15 months
pgeom(1200 * (15/12), .001)
## [1] 0.7772602
# probability injured in next 100 hours in 1200 hours
pgeom(100, .001)
## [1] 0.09611265
6. 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? What is the expected value?
# fail more than twice in 1000 hours
pbinom(2, size = 1000, prob = .001, lower.tail = F)
## [1] 0.08020934
# expected value
1 / 1000
## [1] 0.001
7. 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? 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? What is the expected waiting time?
# probability of patient wait more than 10 minutes
punif(10, min = 0, max = 30, lower.tail = F)
## [1] 0.6666667
# after 10 minutes, probability of at least another 5 min
punif(15, min = 10, max = 30, lower.tail = F)
## [1] 0.75
# expected waiting time
30 * .5
## [1] 15
8. 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? What is the standard deviation? What is the probability that your MRI will fail after 8 years? 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?
Expected failure time is after 10 years.
The standard deviation is always equal to the mean. So the standard deviation is 10 years
# probability of MRI fail after 8 years
pexp(8, rate=1/10, lower.tail = F)
## [1] 0.449329
# after owning machine 8 years, probability of fail in next 2 years
pexp(8, rate=1/10, lower.tail = F) - pexp(10, rate=1/10, lower.tail = F)
## [1] 0.08144952