Learn fundamental concepts in data analysis and statistical inference, focusing on one and two independent samples.

Loading...

From the course by Johns Hopkins University

Mathematical Biostatistics Boot Camp 2

34 ratings

Johns Hopkins University

34 ratings

Learn fundamental concepts in data analysis and statistical inference, focusing on one and two independent samples.

From the lesson

Hypothesis Testing

In this module, you'll get an introduction to hypothesis testing, a core concept in statistics. We'll cover hypothesis testing for basic one and two group settings as well as power. After you've watched the videos and tried the homework, take a stab at the quiz.

- Brian Caffo, PhDProfessor, Biostatistics

Bloomberg School of Public Health

Okay, so, we went through some extra steps there.

Â In general, we don't convert our constant that

Â we're interested in, back to the original scale.

Â Right, we just take the standardized mean,

Â and compare it to standard, normal quantile.

Â So in this example. Remember, 32 was our empirical mean.

Â 30 is the mean under

Â the null hypothesis.

Â And the standard error of the mean in this case was 10 divided by square root 100.

Â So the mean expressed in standard devi-

Â standard error units from the hypothesized mean

Â works out to be two, 32 minus 30 divided by the standard error, two.

Â So

Â [INAUDIBLE]

Â our mean is two standard eeror units away from the hypothesized

Â mean. Then we would compare that to the

Â 95th percentile for the standard normal distribution.

Â which is 1.645 so we would directly compare a 2 and 1.645.

Â So that's a, that's just a quicker way to do it.

Â So we can

Â [UNKNOWN]

Â these rules for a normal test for a single mean and do a couple of simple rules.

Â So let's just call this the Z test, because we're talking about

Â testing a single mean, we're either assuming that our data, we're willing

Â to assume that our data is Gaussian, or that our data, or

Â that the central limit theorem is a good enough approximation to apply.

Â Suppose we want to test the null hypothesis, that mu equals mu naught.

Â H naught isn't, mu equals mu naught, versus one of the three alternatives.

Â The, the, mu being less than mu naught, mu being greater than

Â mu naught, and the middle one here, mu not equal to mu naught.

Â And that one, we'll have to talk a little bit about.

Â In all three cases, we're going to say, well,

Â we're going to reject for H1 say for sample

Â mean, is small enough. Right, and if it's enough below mu naught.

Â We're going to reject in the case of H3,

Â if our sample mean is enough above mu naught.

Â And then in the second case, we're going to just reject if our sample

Â mu is enough different from mu naught, either too large or too small.

Â And again, just like before, the logical way to

Â do this is to express the mean in standard

Â error units, in standardized units.

Â So, when we calculate our test statistic, it's x bar

Â minus the hypothesized mean under the null value, mu naught.

Â Divided by the standard error, s over square root n.

Â that then is a z-score.

Â It is a, it is a sample mean expressed in standard error units.

Â so if we get, for example three, we would know that the sample

Â mean is three standard deviations above the hypothesized mean.

Â Right?

Â And so we, we observed the sample mean

Â that is 3 standard errors above the hypothesized mean.

Â Which is, which would be unlikely, right?

Â So that maybe casts some doubt on the hypothesized mean.

Â If we observe a sample mean

Â that is say, four standard deviations below the hypothesized mean.

Â Again, that would, that would be evidence in favor of H1.

Â If it was four standard deviations above the hypothesized

Â mean, that would be evidence in favor of H3.

Â And so we can actually force, if we wanted alpha-level error rates, so when

Â I prove this example, alpha was 5%, so alpha, again, remember, is the probability

Â of a type 1 error falsely rejecting the null hypothesis when, in fact, it is true.

Â Then, under H1, bar we would reject if our test

Â statistic was less than negative Z1 minus alpha.

Â So in this case if, you know alpha is 0.05, then we

Â would look up that 95th percentile and then take the negative of it.

Â [INAUDIBLE].

Â We could equivalently look up the fifth percentile.

Â Because the fifth percentile is the negative of the 95 percentile.

Â But I wanted just to say, use the same quantile every time.

Â So, in that case, it would be, negative 1.645, okay?

Â In h3, then, we're going to do exactly what we did in our example.

Â We would compare it to the positive.

Â the, the positive

Â upper quantile, Z1 minus alpha. So the 95th percentile of our alpha.

Â If the error rate we want to control for is 5%.

Â And then for the second case, H2.

Â We will reject if our test statistic is either too large, bigger than Z1

Â minus alpha over 2 or too small, smaller than Z1 minus alpha over 2.

Â And the reason we divide alpha by 2 is because remember

Â we want a 5 per, well alpha percent chance of rejecting the null hypothesis falsely.

Â so if the null hypothesis is true, we want only a 5 per, alpha percent

Â chance 100 times alpha percent chance of rejecting The null hypothesis.

Â So the way that we're going to do this now is, we're going

Â to say, okay we will divide that probability into half of it being

Â accidentally rejected, too large, and the

Â other half being accidentally rejected, too small.

Â And that seems like a pretty sensible, sensible rule to do.

Â So in the, the, the, the execution of that rule is just to say,

Â well, take my test statistic, if it's negative I throw out the negative sign.

Â If it's positive, I just leave it alone.

Â And then I compare it to the upper quantile from the normal distribution.

Â But instead

Â of looking at the 5% error rate, I look at the 2.5% error rate.

Â If I wanted 10% type 1 error rate then I

Â would look at a 5% then 95th percentile and so on.

Â Okay?

Â So let me just describe briefly more of this two tale test idea.

Â So just to let you know that you know,

Â that alpha over two in this case you know if,

Â if alpha is 0.05 then, you know 1 minus 0.05 divided by 2, that

Â works out to be 0.975 in the 0.975th quantile of the normal

Â distribution works out to be about 1.96. And, and what we're

Â doing let's let me get some x and y values.

Â And then plot the standard normal again,

Â which you can see over there. And then, so what, what we have is

Â we have a, a a test statistic that we calculate.

Â And then we're going to reject if it's too large or too small.

Â So, so take for example, What we're going to do is take 1.96, and

Â that puts 2.5% in the upper tail, and then we're going to take

Â negative 1.96, and that's puts 2.5% in the lower tail.

Â Of course then that puts 95% in the middle.

Â So we're going to reject if our test statistic is above

Â positive 1.96, which has a 2.5% chance under the null hypothesis.

Â Or, if our test statistic is below negative 1.96,

Â which has a 2.5% chance under the null hypothesis.

Â So the union of those two events yields a,

Â 5% chance under the null hypothesis and rejecting whether something

Â is bigger than positive 1.X is the same thing

Â as rejecting if the absolute value is bigger than 1.96.

Â So in the way that we're executing hypothesis testing,

Â we've forced the type 1 error rate to be small,

Â it's, it's usually 5% or so. So if we reject the null hypothesis.

Â You know, either our model is wrong or several other things maybe could

Â have gone wrong, or there's a low probability that we've made an error.

Â On the other hand, we have not fixed anything to do with the type two

Â error rate, which is usually called beta. so therefore we

Â sent, intend to say Fail to reject H naught, rather than accepting H naught.

Â The kind of, you know, it's, it's, to give you kind of a classical

Â example of this is imagine if you have a very small sample size, and you

Â want to test some scientific hypothesis, and you

Â fail to reject the null hypothesis Well you've

Â controlled, there's a, the, you know, regardless

Â of your sample size you've controlled the type

Â one error rate so that there's only a 5%

Â chance that you will have rejected the null incorrectly.

Â But if the alternative is true, it''s possible that your small sample size

Â [INAUDIBLE].

Â has, leads to variability in the mean,

Â [INAUDIBLE],

Â right?

Â Because, remember, the standard error of the

Â mean is sigma divided by square root n.

Â So if n is small, our variability of the mean is going to be larger.

Â So if your sample size is small, and you fail to reject h not.

Â it's not fair to say that you should conclude H node if you only have say, a

Â sample of size three then maybe you didn't

Â have a good chance of rejecting the null hypothesis

Â anyway because you didn't collect enough data to really evaluate, evaluate it.

Â So at any rate, that's a bit of novenclature, so that's

Â why we, there's a tendency in, in basically every statistics text book.

Â That teaches hypothesis testing to say, failed or

Â reject H naught, rather than accept H naught.

Â If you want to say that you want to accept H

Â naught, there's an implicit notion that the type two error rate

Â is small, which you know, usually most in problems

Â less is known about of a type two area.

Â And we'll talk, this goes to the subject of things

Â like power which we'll talk about later on in study design.

Â you know that one of the ways to try and combat this problem, issues like this,

Â is prior to the, conducting the study, to design it in such a way That you

Â would, will have a high probability of rejecting the

Â null hypothesis if, in fact, the alternative is true.

Â And one of the things you have under your control for

Â doing that is to, to create, to have a large sample size.

Â so that's one point.

Â And, so any rate, the, so the tendency is to say fail to reject H naught

Â rather than, than rejecting H naught. You know, I think a classic

Â phrase to the people always say is absence of evidence is not evidence

Â of absence, is another way to put that. so that, that's one point.

Â The other point I'm making in this

Â slide is that statistical significance is not the

Â same thing as scientific significance from, from

Â in, in, in the context of hypothesis testing.

Â So the most common argument in favor

Â of this point, is you know we have these, for most of our hypothesis

Â test procedures we have that, you know sharply specified nulls.

Â You know, H naught, H naught is that mu is exactly

Â 5 or something like that, you know, depending on the problem.

Â and so, it's possible if, let's say, you

Â have an enormous sample size, to get a sample

Â mean that's 5.01. With an incredibly small standard error,

Â because you have an enormous sample size, and still reject the null hypothesis,

Â even though 5.01 isn't in any scientific sense different from five.

Â And so, that's the point that's often made, it's that just because you

Â reject the null hypothesis in the terms of prac, in, in the terms

Â of of executing statistical test that doesn't mean

Â the difference that you've detected is in fact meaningful.

Â now you know I've read an argument by, at one point by a person

Â saying that in some instanes for example

Â when you have randomized comparative trials that

Â [UNKNOWN]

Â hyphothesis are still meaningful and even small deviations are, are

Â important but, you know these are kind of subtle issues.

Â I think the main basic issue that, that sort of at least generally understood is

Â that it's not always the case that statistical

Â significance and scientific significance are the same thing.

Â at least generally understood is that it's not always the case

Â that, that statistical significance and

Â scientific significance are the same thing.

Â So I would like you to at least be aware of that and you can read more about it.

Â But, and then before, in the previous slide we said, well,

Â we'll reject if our test statistic is above this value In the

Â case where we're testing H1, we'll reject if it's either it's, it's

Â absolute value is above this particular value in the case of H2.

Â And then we'll reject if it's below this value in the case of H3.

Â That was our

Â rules we came up with in the previous slide.

Â So in H1, the, the upper normal quantile and above.

Â That's called the rejection region and it, again it's H2 the, the,

Â the, the upper quantile and above or the negative quantile and below.

Â In other words the absolute value being above a large value

Â is the the reject, is the, the rejection region in that case.

Â And in the third case The normal

Â [INAUDIBLE]

Â down below is the rejection region.

Â So just the collection of values of test statistics for

Â which you reject the null hypothesis is called a rejection region.

Â Just a bit of nomenclature there.

Â Coursera provides universal access to the worldâ€™s best education, partnering with top universities and organizations to offer courses online.