I am trying to understand the intuition behind Bayesian and frequentist hypothesis testing and came up with the following example to understand the differences. Do you agree that the following reasoning and intuition is correct? Especially the intuitive reason for needing a prior.
Suppose that a covid test has 95% probability of being negative given that the patient is negative and 5% probability of testing positive given that he is negative. Suppose that the same test has a 60% probability of testing positive given that the patient is positive and 40% probability of testing negative given that he is positive. In summary:
$P(\text{tested negative} \vert \text{is negative})=0.95$
$P(\text{tested positive} \vert \text{is negative})=0.05$
$P(\text{tested negative} \vert \text{is positive})=0.40$
$P(\text{tested positive} \vert \text{is positive})=0.60$
Now suppose I want evidence to support the claim that the patient is positive. Suppose the patient tested positive.
Bayesian perspective:
From a Bayesian perspective, the evidence would be in the form of a probability, namely the probability that the patient is indeed positive given that he tested positive = $P(\text{is positive} \vert \text{tested positive})$.
As there are two possibilities:
- The patient tested positive and is positive
- The patient tested positive and is negative
It seems logical that the probability that the patient is positive given that he tested positive, is given by the quotient:
$\frac{P(\text{tested positive} \vert \text{is positive})}{P(\text{tested positive} \vert \text{is positive}) + P(\text{tested negative} \vert \text{is negative})}$ = $\frac{0.05}{0.05 + 0.95}$ = $0.05$
However, this calculation cannot be the correct probability, as it does not take into account the frequencies of being positive and being negative. For example in a country with no covid, the probability being positive should be 0 and not 0.05. Therefore we must multiply the 0.05 by the prior probability of being positive. As we do not know this probability we must set it subjectively.
Frequentist perspective:
From a frequentist perspective, if we want to provide evidence for the claim that the patient is indeed positive then we assume the opposite and assess how unlikely/suprising this result is. Hence, we want to find the probability that the patient is positive given that he is negative = $P(\text{tested positive} \vert \text{is negative})=0.05$. We cannot say that the patient is 5% likely to be positive, but we can say that assuming if he were negative, such a result would only occur 5% of the time. Therefore, if we consider 5% to be suprising enough (95% threshold), we will accept this a strong evidence for the hypothesis that the patient is positive.