Quiz 1 Statistical
InferenceConsider influenza epidemics for two parent heterosexual families. Suppose that the probability is 17% that at least one of the parents has contracted the disease. The probability that the father has contracted influenza is 12% while the probability that both the mother and father have contracted the disease is 6%. What is the probability that the mother has contracted influenza?
(Hints look at lecture 2 around 5:30 and chapter 4 problem 4).
Answer
The events can simultaneously occur and so are not mutually exclusive.
Consider:
According to the formula:
\[\underbrace{P(A \cup B)}_{17\%} = \underbrace{P(A)}_{12\%} + P(B) - \underbrace{P(A \cap B)}_{6\%}\] Thus:
\[P(B) = 17\% - 12\% + 6\% = 11\%\]
A random variable, \(X\) is uniform, a box from 0 to 1 of height 1. (So that its density is \(f(x) = 1\) for \(0 \leq x \leq 1\).) What is its 75th percentile? (Hints, look at lecture 2 around 21:30 and Chapter 5 Problem 5. Also, look up the help function for the qunif command in R.)
(Hints, look at lecture 2 around 21:30 and Chapter 5 Problem 5. Also, look up the help function for the qunif command in R.)
Answer
The 75th percentile represents the blue area.
# Calculating using R.
stats::qunif(p = 0.75, min = 0, max = 1)
## [1] 0.75
You are playing a game with a friend where you flip a coin and if it comes up heads you give her \(X\) dollars and if it comes up tails she gives you \(Y\) dollars. The probability that the coin is heads is p (some number between \(0\) and \(1\)). What has to be true about \(X\) and \(Y\) to make so that both of your expected total earnings is \(0\). The game would then be called โfairโ.
(Hints, look at Lecture 4 from 0 to 6:50 and Chapter 5 Problem 6. Also, for further reading on fair games and gambling, start with the Dutch Book problem).
Answer
\[ Earnings = \underbrace{Profit}_{Y} \cdot \underbrace{P(Tail)}_{1-p} - \underbrace{Loss}_{X} \cdot \underbrace{P(Head)}_{p}\]
\[ \underbrace{Profit}_{Y} \cdot \underbrace{P(Tail)}_{1-p} - \underbrace{Loss}_{X} \cdot \underbrace{P(Head)}_{p} = 0\]
\[ Y \cdot 1-p = X \cdot p\] \[ \frac{p}{1-p} = \frac{Y}{X}\]
A density that looks like a normal density (but may or may not be exactly normal) is exactly symmetric about zero. (Symmetric means if you flip it around zero it looks the same.) What is its median?
(Hints, look at quantiles from Lecture 2 around 21:30 and Chapter 2 Problem 7.
Answer
# Symmetric mean 50% in both sides.
qnorm(p = 0.50, mean = 0)
## [1] 0
Consider the following PMF shown below in R
x <- 1:4
p <- x/sum(x)
temp <- rbind(x, p)
rownames(temp) <- c("X", "Prob")
temp
## [,1] [,2] [,3] [,4]
## X 1.0 2.0 3.0 4.0
## Prob 0.1 0.2 0.3 0.4
What is the mean?
(Hint, watch Lecture 4 on expectations of PMFs.)
Answer
sum(temp["X",] * temp["Prob",])/sum(temp["Prob",])
## [1] 3
A web site (www.medicine.ox.ac.uk/bandolier/band64/b64-7.html) for home pregnancy tests cites the following: โWhen the subjects using the test were women who collected and tested their own samples, the overall sensitivity was 75%. Specificity was also low, in the range 52% to 75%.โ Assume the lower value for the specificity. Suppose a subject has a positive test and that 30% of women taking pregnancy tests are actually pregnant. What number is closest to the probability of pregnancy given the positive test?
(Hints, watch Lecture 3 at around 7 minutes for a similar example. Also, thereโs a lot of Bayesโ rule problems and descriptions out there, for example hereโs one for HIV testing. Note, discussions of Bayesโ rule can get pretty heady. So if itโs new to you, stick to basic treatments of the problem. Also see Chapter 3 Question 5.)
Answer
\[ P(D|+) = \frac{\overbrace{P(+|D)}^{sensitivity} \cdot \overbrace{P(D)}^{prevalence}}{P(+|D) \cdot P(D)+[1-\underbrace{P(-|D^C)}_{specificity}] \cdot [1-P(D)]}\] \[ P(D|+) = \frac{\overbrace{0.75}^{sensitivity} \cdot \overbrace{0.30}^{prevalence}}{0.75 \cdot 0.30+[1-\underbrace{0.52}_{specificity}] \cdot [1-0.30]} = 0.4011\]
#Calculating using R.
(0.75*0.30)/(0.75*0.30+0.48*0.70)
## [1] 0.4010695