Likelihood

hypothesis testing


Hypothesis testing

You want to know if a treatment (drug, class, whatever) causes a significant difference in the outcome. You do this by administering the treatment to two comparable subjects. Then you measure the outcomes. There is natural variation in outcomes whether or not the treatment works. You can repeat the test on other subjects to be more certain about your conclusion.

Frequentist Framework

H0 is the null hypothesis, which is where the outcome does not change. It is the default distribution of outcomes.

H1 is the hypothesis that the treatment causes better outcomes. It is the distribution for a working treatment.

base rate is the true probability that the treatment will work.

p-value is the probability that you will get a measurement greater than the one you got under the null hypothesis.

power is the probability that you will get a measurement greater than the one you got under H1.



Baysian Framework

There are actually some substantive differences between the Baysian framework and the frequentist framework for this problem. More on this later.

X is a random variable that represents the true state of the subject. X is 0 under the null hypothesis. X is 1 if the treatment worked.

Y is a random variable that represents the measurement of the state of the subject.

P(X) = base rate

P(Y|1-X) = p-value

P(Y|X) = power

P(X|Y) = true positives = 0.640

This is the probability that the treatment didn't work even though you measured that it did. This is often counterintuitive, especially if the base rate is very low.

P(X|Y) = P(X)*P(Y|X)/P(Y) = base rate * power / P(Y)
P(1-Y) = P(1-Y n X) + P(1-Y n 1-X)
P(1-Y) = P(X)*P(1-Y|X) + P(1-X)*P(1-Y|1-X)
1 - P(Y) = base rate *(1-power) + (1 - base rate)* (1 - p-value)

then P(X|Y) = base rate*power /(1 - base rate *(1-power) - (1-base rate)*(1 - p-value))