< Return to Video

Hypothesis Testing for Proportions

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

English subtitles

Revisions Compare revisions