-
Hi. This video is a continuation
of our hypothesis testing video.
-
We just finished an example
of doing hypothesis testing for means.
-
One sample.
-
Now we're going to talk about a one sample
hypothesis test for proportions.
-
Up here.
-
Our previous example, I talked about
the major steps that you take.
-
You state your hypotheses,
collect data, construct a test statistic.
-
Apply
a decision rule, either a critical region
-
or a p value,
and draw conclusions in context.
-
So we're going to follow this exact
same steps again here.
-
So I'm going to say
this is for proportions. Now
-
our null hypothesis is well
-
I guess the research question is
is we're going to be interested in seeing
-
if, the proportion of red haired
-
people is equal to 0.15. So,
-
proportion of red
-
haired people is 0.15.
-
And the alternative we're
just going to do, it's simply a two sided.
-
So proportion of red haired people is not
-
.15 okay.
-
The data we are going to be using
is from the hair eye color dataset.
-
Same dataset we used in our confidence
interval section.
-
So as you can see here,
it has a table of different hair
-
colors, eye colors
and different sexes for students.
-
So to get the total number
of red haired people, you just sum up
-
all of the values of red haired people.
-
So ten plus ten plus seven
plus seven, and then 16 plus seven
-
plus seven,
-
will give you 71.
-
Okay.
-
I'm just gonna put a note here.
-
71 red two.
-
Okay.
-
So a test
-
statistic for a proportion is given.
-
You're going to need to have a,
-
a p hat value.
-
You're going to need
to have a hypothesized value.
-
And you're going to need to know
the number of observations.
-
So I'm going to do the total number
of observations first.
-
So we're going to
-
just we're not actually going
to use the length function in this case.
-
Since this is in a table,
I'm going to just sum up
-
all of the numbers in this whole table.
-
And that'll give us the total number
of observations in this data set,
-
which is 592.
-
And then our, p
hat is our sample proportion.
-
So our sample we had 71
-
red, red haired people.
-
And in order to get a proportion,
we need to divide that by the total number
-
of people.
-
So that'll be 71 divided by five, 92,
-
which is also equal to 2.1199.
-
And then the last thing we will need
is whatever
-
our hypothesized proportion
is usually denoted like with p naught.
-
So I'm going to call it p zero.
-
And this is chosen by us
the researcher or the station.
-
And it is point one of five.
-
Okay.
-
So now since we usually use
-
a standard normal table
or a normal distribution for proportions,
-
I'm going to call this
the r z test statistic.
-
And for a proportion, it's
-
we will calculate it as being p hat
-
minus p, not the hypothesized value
-
divided by the square root of.
-
Now there's a numerator and denominator
-
inside this.
-
Inside this square root.
-
So it's going to have
a lot of parentheses.
-
But if you just are very aware of all
your parentheses, it'll be just fine.
-
So this is p
-
naught times one minus p naught.
-
Then outside of what.
-
But let's see.
-
All right.
-
So we have closed the parentheses
for this one.
-
And then.
-
Close
-
the parentheses for that p naught times
one minus p naught.
-
So it's still inside the square root.
-
We will also divide that by n
and then this parentheses
-
will close off the end of the square root.
-
And that'll close off
the end of the denominator.
-
And that will give us.
-
A value of -2.0488.
-
So that is our test statistic.
-
For this hypothesis test.
-
Now to apply a decision rule
-
we're going to start off
with our rejection region.
-
Before we do that, we always have
-
the researcher set our preferred
or a set significance level,
-
usually 0.05,
but obviously that is up to you.
-
So we
are going to find a rejection region.
-
And we are going to be
using the Q norm functions
-
because we use the normal distribution
when doing
-
and any kind of inference
with proportions.
-
And we want to find a tail probability
that is our significance
-
level divided by two because we are doing
a two sided hypothesis test.
-
So we want the two tails
to each have alpha over two.
-
And since our test statistic is negative
mean meaning that
-
it's on the left hand side of the curve,
we want to get a lower or a,
-
left hand probability.
-
Tail probability.
-
We're going to say lower up
tail equals true.
-
To and then our value
-
where we would reject is -1.96.
-
So this tells us that if we got a test,
-
if we ever get a test statistic
that is less than -1.96
-
or greater than positive 1.96,
-
we will reject the null hypothesis.
-
Our test statistic is smaller
-
than -1.96.
-
So we would reject our null hypothesis
and say that
-
the true proportion of red haired
people is 0.15.
-
Our sample we got was 0.12.
-
So you know, .2.1, 2.15,
you know, pretty close.
-
But it's not exactly 0.15.
-
It's probably something different
-
then if you want to do, a
-
finding
-
you're doing your decision rule.
-
You can also do it with p values.
-
So we are doing a two sided test again.
-
So we will also multiply this and p
-
the p like tail value
probability value by two.
-
And the critical value
that we will plug in here
-
to find
the probability is z dot test of stat.
-
The one we got from our data.
-
And again
we will say lower tail equals true
-
because we are finding a
extreme or tail probability.
-
So our
-
two sided p value is 0.0405.
-
And so this is where we compare it
to our alpha value which is 0.05.
-
So if our p value is less than alpha .05
-
that means we reject our null hypothesis.
-
This value is just barely,
but it is still less than 0.05.
-
So in this case
we would reject our null hypothesis again.
-
And see that the true proportion of red
-
haired people is 0.15.
-
Where, whatever decision rule
you applied, whether it's rejection
-
region or a p value, you should be coming
to the same conclusion.
-
On whether to reject or fail
to reject the null hypothesis.
-
You shouldn't
be getting different conclusions
-
with these.
-
And there are other functions,
kind of like
-
how I talked about the confidence
intervals for proportion video.
-
There are, functions out there that can do
-
a one sample proportion test,
-
because, you know,
for means you can easily just use t test.
-
But there
are ones for proportions out there,
-
but they do require you to download
other packages
-
and kind of do the research
and find out those other functions.
-
And so just to kind of make it
as simple as possible for you guys
-
so you don't have to go find out
all that information.
-
We thought we would just show you
how to do it by hand here, and,
-
you'll get the same conclusions. So
-
anyway, hopefully that this
these videos were helpful for you
-
in helping out with hypothesis
testing for means and for proportions.
-
All right.
-
We will see you later in the next video.
-
Have a good one.