 Part two So the test statistic is used to find what is called a p-value a P-value or a probability value is the probability of getting a value of the test statistic That is at least as extreme as the one representing the sample data Assuming that the null hypothesis is true. Basically, it's looking at What's the probability our test statistic is likely? So we use the test statistic to find the p-value the critical region or rejection region is the set of all values of the test statistic That cause us to reject the null hypothesis So to find p-values. It's important to take note of the tails in a distribution Determinations of p-values and critical values, which we'll talk about momentarily are affected by whether a critical region is in two tails the left tail or the right tail is Is it correctly as it is important to correctly identify a hypothesis as being two-tailed left-tailed or right-tailed? So how do you know? Well When your null hypothesis is not equal to that means you have a two-tailed test So the critical region is in two tails and the p-value is The sum of the area of the two tails When you have a left-tailed test well, that's when the null hypothesis is less than less than is left-tailed So the critical region is your left tail and the p-value is the area of that left tail and Then your test statistic Will be what separates that critical region from the rest of the graph The right tail test is whenever your alternative hypothesis is greater than and the p-value is the area of that right tail All right, so in Google sheets will literally go to the Compute tab and we'll deal with the normal section to find the area of that region under the curve Whether it's left tail right tail or both tails The level of significance denoted by alpha remember that's Your significance level is the probability that the test statistic will fall in the critical region when the null hypothesis is actually true So we'll always assume alpha is point zero five if no level of significance is given So what happens is we compare the p-value to this level of significance and instantly? We know whether or not to reject or fail to reject meaning keep the null hypothesis So here's the decision-making criteria If the p-value is less than or equal to alpha if the p-value is less than or equal to alpha alpha is a limbo Bar we want the p-value less we reject the null hypothesis So by weeding out the null hypothesis it gives the possibility that the alternative hypothesis is Potentially true and if the p-value is greater than alpha we fail to reject the null hypothesis If we fail to reject the null hypothesis, we cannot say anything about the alternative. We're stuck with the null all right, so keep in mind p-value is a probability and Proportion is the percentage of a population that has a certain characteristic Let's practice finding a p-value So find the p-value for a test statistic of z equals one point sixty Determine the conclusion All right, so draw your visual So this is the same example. Remember what our hypotheses are So we have p equals point five and we have p is greater than point five So in our bell curve, this is a standard normal curve. We're dealing with z scores. So the mean is zero. Where's one point six Somewhere to the right of zero So I want to find the area to the right of one point sixty This is a right tail test so that my rejection region should be the right tail the right tail should be what I shade so I Want to know what is the p-value? So your job is to go to Google sheets And go to the compute tab and Then go to the normal region for z mu is zero Sigma is one Lower bound where does the shading start? 1.60 once again using the visuals very helpful. Where does the shading stop? Well at infinity, so you just write six nines So let's find that p-value Let's find that p-value Zero one one point six and six nines To find the p-value from scratch from the test statistic We go to the compute tab to the normal region make sure you have zero and one typed in from you and sigma Our lower bound is going to be our test statistic 1.60 and our upper bound is going to be six nines and you have a p-value of point zero five four eight usually p-values are rounded to four decimal places point zero five four eight And so we get point zero five Four eight, so let's compare that to alpha We'll assume alphas point zero five is the p-value Less than greater than alpha Well, it's greater than so since we're not less than alpha We fail to reject the null hypothesis We fail to reject H naught Let's talk about critical value now So one way to actually run your hypothesis test is to calculate the test statistic find the p-value compared to alpha That's the p-value approach, which is what we'll use most of this class But there's also a critical value approach a critical value is any value which separates the critical region from the values of the test Statistics that do not lead the rejection of the null hypothesis. It depends on the level of significance alpha So critical value is basically that cutoff where you have Test statistics that reject the null or fail to reject the null and we'll still use the compute tab and Google Sheets and We'll actually use the area to the left portion of the normal region So we're finding a data value. We're finding a value along the x-axis. We're finding a critical value So we're using area to the left So here's the decision criteria when you use a critical value method If the test statistic falls within the critical region We reject the null hypothesis if the test statistic does not fall within the critical region Or the rejection region as we call it we fail to reject the null hypothesis So let's find the critical values for the gender selection method and let's determine the conclusion So let's look alpha is point zero five. We always use a level of significance of point zero five if they don't give us one So what type of test is this left-hailed two-tailed or rat-tailed Well, you can look at the fact that you have greater than for your alternative hypothesis. So this is a right-tailed test You are looking for The value the critical value CV critical value That separates this rejection region that I've shaded from the rest of the bell curve and the area of that Rejection region is going to be alpha Always the area of that shaded region when you do critical value methods is always alpha point zero five So whenever you go to Google sheets You're dealing with z scores so mu is zero sigma is one What is area to the left? Well, if the area to the right is point zero five Area to the left is one minus that Look at your picture use your picture All right, so my critical value Let's use Google sheets area to the left is point nine five Point nine five Area to the left is point nine five. What is the critical value one point six four one point six four? So we get one point six four so we have One point six four, but what was our test statistic? Well, that was one point six where does one point six lie does it lie within the shaded rejection region? Or does it lie just outside? well guess what One point six is not in The critical region or the rejection region that means We fail to reject the null hypothesis So we fail to reject the null hypothesis because our test statistic is not in that critical region It's very important you draw the picture and have this visual so you have to write a formal conclusion for your hypothesis test and How you craft your conclusion is that it's always in terms of the claim you always write your conclusion in terms of the claim however Based on whether you reject or fail to reject H not it's going to impact how your statements written and Based on if your claim is the null or alternative also Effects it so first you determine did I reject the null hypothesis or did I fail to reject it? Well, if you reject the null the null hypothesis and the original claim Does not include equality Then you have a statement form of there is sufficient evidence to support to support the claim that blah blah blah blah blah if you rejected a null hypothesis and the original claim includes equality So that means the original claim is the null You say there is sufficient evidence to warrant rejection of the claim that blank If you fail to reject the null hypothesis and the original claim does not include equality remember That's the claims H1 then you write your statement if you fail to reject the null hypothesis and the original claim includes equality Meaning it's a null hypothesis you write your statement So you always write your statement in terms of the claim To use this table follow the format for the conclusion based on what your conditions are So write a conclusion for the gender selection method that with the gender selection method the proportion of girls is greater than 50% Use both the p-value and the critical value method So as a little recap here when I do the p-value method I received a p-value of 0.0548 I'll get just a little heading here and then My alpha was point zero of five So we compared the two we compared the p-value to alpha we determined it was greater than So that meant we failed to reject H naught All right, and then there was the critical value method a less commonly used method and for that We said okay the test statistic that we calculated was actually going to be 1.6 And then our critical value Was equal to 1.64. All right, so since Since The test statistic Was less than the critical value Remember our picture This makes it easier to see we had a rejection region in the right tail because this was a greater than test It was a right tail test. We said 164 was to cut off Since 1.6 is not in that region. We fail to reject H naught so that being said because Remember our hypotheses we had Proportion was equal to point five. We had proportion was greater than point five and remember our claim was the alternative so we failed to reject H naught and Our claim was the alternative hypothesis. It did not contain equality So we use the following statement There is not sufficient evidence to support the claim that with the gender selection method The proportion of girls is greater than 50% so because we could not fail to reject Sorry because we could not reject the null hypothesis. We failed to reject it We cannot say anything about the alternative. There's no evidence to say anything about it You can't fail if you can't reject the null hypothesis If you can't scratch out the null hypothesis, there's no way you can say anything about the alternative Now hypothesis test we assume the null hypothesis is always true unless evidence shows otherwise So fail to reject says more correctly that the available evidence is not strong enough to reject the null hypothesis We don't always we don't just say the word accept Although the two in common language fail to reject except may mean the same thing In statistics, it's proper to say Fail to reject Otherwise you'll make the mathematicians or statisticians angry. You should always in a formal setting say fail to reject Psychologically though if you want to think except that's fine with me All right, when you perform a hypothesis test you also have the possibility of Performing an error there could be an error in your results Not a mathematical calculation error, but an actual error just because statistics is not always right It's correct a certain number of times but not always so if you were to fail to reject the null hypothesis and The alternative hypothesis is actually the true one. That's called a type 2 error If you were to reject the null hypothesis and the null hypothesis is actually true So it's like cleaning out the fridge and you had good food in there But you threw it away That's a type 1 error So in the context of this test Let's identify what would be a type 1 error and what would be a type 2 error All right, so remember what type 1 is so a type 1 error was If we were to reject H not But it was actually true So we were to strike out the null hypothesis, but it was actually true So we would say a type 1 error would be we would conclude the proportion of girls Is greater than 0.5? when It really isn't when it is actually 0.5 and then there's the type 2 error for a type 2 error We would fail to reject H not When indeed H1 is true So in this case we would literally conclude the proportion of girls is Equal to 0.5 and treatment has no effect when it really is Greater than 0.5 So our type 2 error is looking at hey this treatment was not effective When it actually was That's your type 2 error and we don't really focus on error too much in this course It's just important to know that hypothesis test can have errors and you're like well How can I make sure there's not any error? Well, it also depends on your level of significance alpha that you pick your level of significance alpha Can reduce one type of error, but it can increase the others So you got to kind of pick this happy medium when you run your test But enough of that enough of error enough of the introduction that hypothesis testing That's all I have for now. Thanks for watching