4.7 The R&D department of a company has developed a new home screening test for diabetes. A demonstration of the type of results that may occur was mandated by upper management. Simulate the probability of obtaining at least 24 positive results and 6 negative results in a set of 30 results. The researchers state that the probability of obtaining a positive result is 80%.
Let a two-digit number represent the outcome of running the screening test. Which numbers should represent a positive result?
Approximate the probability of obtaining at least 24 positive results and 6 negative results in a set of 30 results by generating 10,000 sets of 30 two-digit numbers.
An R Script can work for solving this problem as:
----------------------------------------------------------------------------------------------------------
## Simulation of a list of 10000 random samples with TRUE (+ve)
and FALSE (-ve)
rnd <- list()
for(i in 1:10000){
rnd[[i]] <- sample(c(T, F), size = 30, replace = T, prob =
c(0.8, 0.2))
}
## Generate a vector to obtain the respective 2-digit numbers of
TRUEs (+ve) in the simulations
asgn.num <- c()
for(i in 1:10000){
asgn.num[i] <- sum(rnd[[i]])
}
## Unique two digits are
unique(asgn.num)
----------------------------------------------------------------------------------------------------------
(i) For first question for positive results we can assign the numbers:
22, 26, 24, 21, 25, 28, 23, 27, 19, 30, 20, 29, 17, 18, 16, 15, 14
(ii) The ratio for approximate probability can be given by the R code:
----------------------------------------------------------------------------------------------------------
sum(asgn.num >= 24)/10000
----------------------------------------------------------------------------------------------------------
which is always near by 0.60.
Get Answers For Free
Most questions answered within 1 hours.