Hypothesis Testing on small sample

date posted: 2020-06-07




TMI of the day

  1. If I post more than one blog a day, I've got nothing to say sorry.


Hypothesis testing on small sample

A new pharmaceutical company recently invented a drug to cure covid-19 virus. They say that their drug has an effect 90% of the time. You are very skeptical, you believe that drugs' effectiveness must be less than 90% and want to test it yourself. You've gathered 15 sample 11 people were cured and 4 people were not cured. So is the drug effective 90% of the time?

To answer this question we will use Hypothesis testing in steps.

Step 1: State Null and Alternative Hypothesis.

  • Initial belief = Null hypothesis(Ho) = P(drug effective) = 0.9
  • Your belief = Alternative hypothesis(Ha) = P(drug Not effective) < 0.9

Step 2: Find test statistics.

Test statistics is a parameter of sample we will use to reject or approve null hypothesis. When person is given a drug they are either cured (with 90%) or not cured (with 10%) according to the pharmaceutical company. This as you can tell is a binomial distribution so based on initial belief of the company our probability distribution would be X ~ B(15, 0.9). Remember that since we assume null is true, we've set cure rate as 0.9.

Step 3: Set alpha and find p-value.

Next we set alpha also known as level of significance to be 0.05. Reason we are setting alpha before calculating p-value is to reduce bias since if you caluculate p-value first you may set alpha to reject or not reject which ever way favors you.

P-value, given cure rate is 0.9 (assuming null is true) why unlikely is the outcome that only 11/15 = 0.73 = 73% are cured? so if p-value is 0.03 it means that our outcome will happen only 3% of the time if we run same experiment on same number of sample 100 times which is very unlikely.

So what is probability that less than or equal to 11 people cured is a outcome? P(X <= 11)?

Since this is binomial distribution:
P(X <= 11) = 1 - P(X >= 12)
P(X <= 11) = 1 - ( [(15C12) * (0.1^3) * (0.9^12)] + [(15C13) * (0.1^2) * (0.9^13)] + [(15C14) * (0.1^1) * (0.9^14)] ) P(X <= 11) = 0.0555

Step 4: Draw conclusion

Assuming null is true our probability of our outcome of 11/15 cured occuring is 0.055. This is greather than our alpha 0.05 therefore we cannot reject null hypothesis thus null is true. We conclude drug is effective 90% of the time.