I will try to explain hypothesis testing
in a way that, even high school student
can understand it easily.
Let's say there is a pharma company
called Atliq Pharmaceutical
and they have a drug A, which is a very
popular drug for treating headache. So if
you have a headache if you take drug A,
you know it cures it within few hours
and it is being used by millions of
people
very popular drug. Now the scientists in
this company invents a new drug called
drug B
and they claim
that drug B takes less time to cure
headache
compared to A. So, the claim is that total
number of hours that are needed to cure
headache are less if you take drug B
versus drug A. Now, how do you prove that
you can't roll out that drug B and give
it to millions of people,
right. You need to first test it. Do, do a
clinical trial.
How would you get 10 volunteers and 10
volunteers who are having headache and
give drug A to 5 volunteer and drug B to
remaining 5 and kind of measure a time.
Let's say drug A takes four hour to get
rid of headache drug B takes only three
hours to get rid..er rid of headache. Did we
prove that drug B is effective than A?
Well, obviously answer is no, because our
sample size is very small. In statistics
since you can't test certain things on
the entire population, we take a sample
and here our sample was 10 volunteers
and 10 volunteers versus millions of
people is definitely a very small sample.
so we can say that maybe
this happened because of a random chance,
or the sample is
not good enough to give you confidence
that B is more effective than A, then
what do you do?
When you increase the sample size let's
say you
take 1000 volunteers maybe
500 are taking drug A 500 are taking
drug B. Again drug B takes average three
hours the drug A takes average four
hours to
get rid of headache completely have we
proven that B is effective and are we in
a position to roll it out to millions of
people?
Well, maybe not, not sure because thousand
verses millions of people maybe
thousands still is not a big enough size.
Other problem is
what if
the 500 people on whom you tested B are
all young folks you know with better
immunity and
remaining 500 people on whom you
used drug A they are old folks or they
have underlying condition their immunity
is a little weak, you know. So it depends
on the two factors one is the sample
size and how much variation you have in
that sample. Do you have people from all
age groups different medical condition,
different ethnicity,
you need to consider a lot of factor in
order to conduct an effective test. Now
let me give you another example
of coin flipping.
So what, I did once is I had this coin I
flipped it seven times
and usually you expect that you will get
head and tail you know equal number of
times.
What happened for me is in first four
times, I got
head
and I started thinking maybe there is
something wrong with this coin maybe
it's counterfeit, maybe it is favoring
head.
So you can try this experiment. Try
flipping this coin so many times and
many times you will find that you know
four times, five times, even six seven
times in a sequence you might get head
or tail and you will think there is
something wrong with the coin, but the
reality is that
nature tricks you.
Nature tricks you in a way that, you will
start thinking that,
there is an underlying reason behind an
event or a phenomena.
Whereas the fact is that it is pure
randomness.
This is the natural law. I'm from India.
I've seen enough examples of successful
astrologists
who try to predict your future, who will
you know that there was one astrologist
who who used to say
that okay
at age 35 you will
you will have unexpected monetary
benefit, maybe you will win a lottery or
you will get it from like bonus or
something. Now if you make that claim to
100 people maybe
20 or 30 people you will get it right
and that's just because of pure
randomness,
but then people think that no, this
astrologer knows how to see the future.
So they
they think of randomness, you know
actually the underlying course is
randomness but the way the events are
happening in nature it makes you think
that there is an underlying reason and
the purpose of hypothesis testing is to
get rid of this element of randomness.
Basically it is to figure out that
observed result is not because of a
random chance and there is a strong
reason behind it. So, in our case
drug B is more effective than A and in
our test that we are performing
hypothesis testing allows you to rule
out
the
the element of a randomness. So if you do
hypothesis testing you can
scientifically prove that
drug B is more effective than A and how
exactly hypothesis testing is con
is conducted is beyond the scope of this
video, but I will talk about some of the
methods. Now in our case drug B being
more effective than drug A
is called Alternate Hypothesis.
An Alternative Hypothesis is, you know
represented using Ha. So, Ha
means the claim you want to prove
and we always come up with the opposite
hypothesis which is also called a null
hypothesis which is drug B is not more
effective than drug A.
So, drug B not being more effective than
drug A is null hypothesis and null
hypothesis and alternate hypothesis they
are exactly opposite.
Now, why do we need null hypothesis why
can't we directly prove that drug B is
more effective than drug A.
Well,
null hypothesis first of all represents
the
established fact. What is the established
fact? Well, drug A is the more most
effective drug by Atliq
Pharmaceutical in the market. so drug A
is being used by millions of people
since past five years and it is the
established fact,
and if someone is coming up with drug B
and saying that okay drug B is more
effective,
we want to play devil's advocate.
We want to look at that claim with lot
of skepticism and start
our inquiry by saying that no drug B is
not more effective than drug A. drug A
has been very effective since past five
years, so many people have used it so I
don't believe drug B is more effective
than A.
So, we want to start with the established
fact, you know whatever is true as of now
and then
we do couple of tests, you know using
hypothesis testing and try to prove that
my null hypothesis is wrong
or my null we try to reject the null
hypothesis basically. We try to reject
that drug B is not more effective than A.
When you reject that you automatically
prove that drug B is actually effective
then drug
A. It is like going to a courtroom, you
know someone committed a murder but we
always
say innocent until proven guilty. So in
the court we'll always start with us by
saying that okay this person is innocent,
they have not committed a murder and
then the lawyers on the opposite end
will try to reject that statement. So
null hypothesis is the person is not
guilty and the lawyers on the opposite
side will try to prove that this
statement that the person is not guilty
is wrong.
And by doing that they prove that the
person is guilty. There are many examples
of null hypothesis and alternative
hypothesis and I'll go through some of
them. Back in time it used to believe,
people used to believe that the
sun
rotates around the earth.
So people in back in days used to
believe earth is static at the place, sun
rotates around it. Then Copernicus came
in with a theory that no that is not
true. So the null hypothesis at that time
was sun rotates around the earth. It was
a widely accepted belief for many years
and then someone comes and says that
no
this is not true
that sun rotates around the earth and
when you reject that claim
automatically the second most claim that
is there
becomes kind of an established truth. So
the way it works is
the claim that you're trying to prove
you cannot say for sure that this is the
truth.
So whatever is the opposite you try to
reject it and then this second established,
second most established thing kind of
becomes the truth. It's like
you know at some point Roger Federer was
number one player one one number one
tennis player. So the null hypothesis is
Roger Federer is the best tennis player.
Then Djokovic came in and now you want
to say
Djokovic is
better player than Federer.
But instead of proving that, what if you
prove that Federer is not the
best player or he's not the
number one player and when you do that
automatically number two who is Djokovic
becomes number one.
And you don't want to say that
okay Djokovic is the best player because
tomorrow someone else might come in. So
that the statement that Djokovic is is the
best player. It's hard to prove you know,
it's not an absolute fact.
Things are always changing so someone
can come in and say okay someone some
new player will come and
they they they can become a best player.
So,
there's a whole idea behind
having null hypothesis. So in hypothesis
testing
you have a claim that you want to prove
that is called Alternate Hypothesis you
go with the alternate claim which is an
which is an established fact
or widely accepted phenomena
and you try to reject that. Another
example is you know up till now before
pandemic
the belief was employees are more
productive in office.
Now that's how the world has been and
everyone knows that and you know that's
my null hypothesis
and some HR people are coming up with a
theory that
employees can be more
can be productive at home also. So
basically the opposite it's not like
employees have to be in office in order
to become more productive. Now that's a
new thing you know that's a new thing we
have not experienced it much maybe one
and a half year into pandemic now we
know a little bit but people working
from office has been like that since
thousands of years.
So that's my null hypothesis and my new
hypothesis alternate hypothesis is employee
can be more productive working from home
as well.
Third example, I want to give is
irritable bowel disease has no
relationship with food that you eat.
That's an accepted belief right now in
medical science and some new scientist
comes up with a theory that no
by eating certain food it can cause
irritable bowel disease. So then the null
hypothesis which is irritable bowel
disease has no relation with
food
you can reject that and if you reject
that you kind of establish the fact that
these two have a relationship. Let's say
you are a data scientist working in
Amazon. You have built this
recommendation engine, you know which
shows you
product recommendation and there is a
machine learning model behind it
and that machine learning model is let's
say A. Okay, so the and
people and amazon has been using this
model for maybe two years you know three
years so many people are using it. So
null hypothesis is so basically the the
model A is something that is established
fact that is something being used by so
many people and now a data scientist
working at amazon comes up with a new
model, Model B
and they claim that model B is better
than model A, they provide better product
recommendation.
So in order to prove that you have to
come up with null hypothesis which will
be
B is not better than A and you try to
reject it, when you reject it you
automatically prove that A is better
than A. So now the question is how do you
exactly conduct hypothesis testing.
There are many techniques Z-test, T-test,
Anova, Chi-Square or Chi-Square test. So
there are so many techniques that allows
you to eliminate the factor of
randomness from the claim that you're
testing.
Okay, so that's what hypothesis testing
is all about. I hope this video gave you
some idea, if you have any question post
in a video comment below. I have the
entire series of
math and statistics for data science
knowing these concepts are going to be
super useful if you are pursuing a data
science career journey. If you have any
questions again post in a comment below.
Thank You
[Music]