 Hello and welcome back. So previously we learned that there's a lot of different things going on when we perform a hypothesis test. So what we're going to do now is kind of put all these things together and get a little bit of practice and with calculating or doing all the various calculations for a hypothesis test. So in my example I have a random survey of 75 death row inmates and that revealed that the mean length of time on death row is 17.4 years with a standard deviation of 6.3. So those are my sample statistics. We'll conduct a hypothesis test to determine if the population mean on death row could likely be 15 years. So likely be means equals to we're looking at the mean being equal to 15. So state the hypotheses and identify the claim. So you have your null hypothesis and you have your alternative hypothesis. Mu equals 15 would go to which one? Which hypothesis always has the equal to? That would be your null hypothesis. Your claim would have to be your null hypothesis. So what would the alternative be? What's the opposite of equal to? Well not equal to. So we're dealing with what is called a two-tailed test here. Now that that's done remember what our hypotheses are. Mu equals 15 for the null hypothesis. Mu is not equal to 15 for the alternative hypothesis. And now I want to calculate the test statistic. So we're going to have to use one of the test statistic formulas here. Since I'm dealing with the mean since the population standard deviation is unknown I will use the following test statistic formula. X bar minus mu over s divided by square root of n. X bar is my sample mean. X bar is 17.4. Mu is 15. It's the population mean value that we're dealing with in our hypotheses. 15. Your sample standard deviation is 6.3 and your sample size n is 75. So square root of 75. So when you do your calculation on top you're actually going to get 2.4 and on the bottom you'll actually end up getting 0.7275. So make sure you are plugging this into your calculator correctly and you get 0.7275 for the bottom. And when you divide these two values you will get a test statistic of 3.3. So now we have to find the p value. So this will be the sum of the area of your quote critical regions. So if you draw your bell curve this is a what-tailed test. Since not equal to is the null is the alternative hypothesis this is a two-tailed test. So shade the right tail of your bell curve, shade the left tail of your bell curve. The sum of these two tails, the sum of these shaded regions will be your p value, the sum of their areas. So I know that 3.3 is the positive, it's a positive test statistic and it's what separates the right region from the rest of the bell curve because you assume that the mean is zero. That's because of the way we calculate our test statistics and how we standardize everything. So our mean in the middle is zero. So how are you going to find the area of that region? For Google Sheets we'll go to the compute tab and we'll just use the normal region. For the sake of simplicity we'll stick to using the normal region on the compute tab. Mu is zero, sigma is one, where does your shading start? What's your lower bound? 3.3 and where does your shading stop? What's your upper bound? It goes on forever so you just put a really big number like six nines. So I will type this into Google Sheets, go to the compute tab, go to the normal region, mu is zero, sigma is one, lower bound is 3.3, upper bound is six nines and let's look at what the area is. It's going to calculate it for us. Decimal places you actually do end up getting point zero zero zero the four rounds up to a five. So point zero zero zero five. So this right tail area is actually point zero zero zero five and because of symmetry about zero the left tail area is also point zero zero five. So that means your p-value because this is a two tail test because it's two tail your p-value will be the sum of your left tail and your right tail. So point zero zero zero five plus point zero zero zero five. You could also just take point zero zero zero five and times it by two but at the end of the day you get point zero zero one. That's going to be your p-value for this test. Let the level of significance be alpha equals point zero five and consider a test statistic of two which is obtained when testing the claim p is greater than point five. So I first want to find the p-value and the first thing I want to make clear to you is always use the test statistic to find the p-value. Always that's the relationship there. The test statistic is used to find the p-value. So let's draw a picture. Let's draw our bell curve. We're dealing with z-scores here. Standardized value so the mean has to be zero. What type of test is this? If I had p is greater than point five which is going to be my you know it would be my alternative hypothesis if I was to write out my hypotheses. Greater than indicates a right tailed test. Right tailed. So on my bell curve I will shade the right tail and the value that separates this right tail from the rest of the graph will be my test statistic of two. So to find the p-value I will use Google Sheets. I have a mu of zero. I have a sigma of one sigma of one. My lower bound would be two and my upper bound would have to be really big number. Let's just say six nines. This is how we find the p-value we use to test statistic. So normal region zero and one your lower bound is going to end up being two and your upper bound six nines. So your p-value to four decimal places is point zero two two eight. Point zero two two eight. That's point zero two two eight. Point zero two two eight. I always like to at least write out part of the word p-value. I don't like to write p equals because then we might get confused with proportions and other fancy notation. So p-value is point zero two two eight. Find the critical values. Well you will use alpha your significance level to find critical values always. We're still dealing with the same type of test. It's still right tailed. Right tailed for life on this example. So shade the right tail and your goal now when you find a critical value is to find the x-axis value that separates the tail from the rest of the graph. Alpha is the area of the shaded tail. Since this is a one-tailed test alpha goes in the entire right tail. So alpha is the area which means point zero five. So in Google Sheets if you want to find the data value you would say okay mu is equal to zero sigma is equal to one and then you need to know the area to the left of the data value you are trying to find. Well if the area to the right is point zero five the area to the left is one minus that. We have to draw the picture. The picture helps put things in the perspective because sometimes you have a right tail test sometimes you have a left tail test sometimes you have a two tail test where you have two tails shaded. So these are the three things we need zero one an area to the left of point nine five. We will type those into Google Sheets zero and one are already there left tailed area point nine five and look at that we have our critical value. So it looks like our critical value is about one point six four. One thing to make sure is if you're not getting the same readings this mean your Google Sheets spreadsheet it's possible somehow the formulas might have been affected. So feel free whenever things don't agree to try resaving a new copy of the spreadsheet using the master link and that should fix your issues about nine out of ten times. So one point six four. So my critical value is one point six four. That's the value that separates usual versus unusual values of the test statistic. Now let's let the level of significance be zero point zero five. Consider a test statistic of z equals negative one point seven five which is obtained when testing the claim p equals one third. So if you were to write out the hypotheses for this test p equals one third is the null and then p not equal to one third would be the alternative. Let's find the p value. I think it's important to know that what we have here is a two tailed test not equal to means we have a two tailed test. So when you find the p value remember p value is found from the test statistic always. Write that statement out a hundred times and I promise you'll never go wrong here. Draw your bell curve and since it's a two tailed test shade the left tail and shade the right tail. I know that I'm dealing with z scores so the mean in the middle is zero. Where would this test statistic of negative one point seven five go? Would it go in the left tail or the right tail? Since it's negative you should go to the left to zero so it should be that cutoff value that separates the left tail from the rest of the bell curve. So what I'm going to do is if I go to sheets Google sheets I have mu equals zero I have sigma equals one I'm finding area under a curve so I need my lower and upper bound for the left region the lower bound is a really big negative number so negative followed by six nines and the upper bound where does the shading stop it stops at negative one point seven five and that's what we're going to type in the Google sheets we're going to find the area of that left tail so zero one I'm using the normal region lower bound is negative six nines and then my upper bound is actually going to end up being negative one point seven five so what is the area of that tail is point zero four zero one the zero and the fourth decimal place rounds up to a one because there's a five afterwards five or higher you round up point zero four zero one point zero four zero one all right so the p value is the sum of the two tails this is a two-tailed test so my p value is going to be whatever my area of one of my tail the tails is times two you add the p value twice or you can multiply it by two either one's going to give you what you need so point zero eight zero two that is your p value so for a two-tailed test you take the area of one of the tails and you double it or add it to itself because the left tail has an area of point zero four zero one which means because of symmetry the right tail has to have an area of point zero four zero one so careful with these two-tailed tests you just don't take the output from google sheets and use that as your answer you have to double it for a two-tailed test well let's find the critical values since it's a two-tailed test you will have two critical values remember critical values are found from alpha so shade your left tail shade your right tail you're looking for a positive critical value and then you'll be looking for a negative critical value two-tailed test means you have two critical values so if alpha is point zero five that leaves how much for each of the regions point zero five divided amongst the two recent regions point zero five divided by two is point oh two five all right so i have point oh two five as the right tailed area point oh two five as the left tailed area to find the negative critical value you'll go to google sheets new is zero sigma is one and then area to the left for the negative critical value the area to the left is point oh two five let's type these three things in the google sheets so i'm finding a critical value i'm finding a data value zero and one and then left tailed area point oh two five you get about negative one point ninety six that's negative one point ninety six so my negative critical value is negative one point ninety six because of symmetry what's my positive critical value positive one point nine six so two-tailed tests have a positive and a negative critical value that's what separates the rejection region or critical region from the rest of the bell curve all right so a lot of practice here with p values critical values and all that fun stuff but remember p value is found from the test statistic and then critical value is found using alpha so let's assume a significance level of alpha equals point zero five and the claim is that women with them have a mean height equal to 160 the hypothesis test results in a p value of point oh six one four so identify the hypotheses and state the conclusion about the null hypothesis so we'll reject it or fail to reject it all right so a mean equal to 160 would that be a null or an alternative hypothesis does it contain equal to yes equality always goes with the null hypothesis what's the opposite not equal to so my claim is my own hypothesis so let's compare the p value to alpha point oh six one four the point oh five remember p value compared to alpha the p value is point oh six is greater than point oh five therefore we cannot reject the null hypothesis we must fail to reject the null hypothesis we fail to reject our claim since we fail to reject our claim that means all eyes are on the null hypothesis all eyes are on the claim that means because my null hypothesis contains my because my null hypothesis was I failed to reject it because the claim contains equality meaning it's the null hypothesis I used the following structure for my statement there is not sufficient evidence to warrant rejection of the claim that women have heights with the mean equal to 160 when your claim is to null hypothesis your statement's always talking about your conclusion in terms of rejection or failure to reject so what you've just learned is basically how to do all the various parts of a hypothesis test and all the do the various calculations using technology to a certain extent what we're going to do next though is literally take everything and type it in the google sheets and google sheets is going to literally tell us the p value and all the other information we need for this hypothesis test so it'll make our job a lot easier so that's all I have for now thanks for watching