 doing hypothesis testing and today's session as well. It's a very long one, so I'm hoping if we're not done by half past four, we can continue until five o'clock, but we will see how far we get as well. What we're doing for the next one hour 30 minutes, we'll be looking at hypothesis testing for the mean and the proportion and this is towards helping you being able to submit your assignment for. Next week, we will do more activities because I realized that also this week and last week, we didn't do a lot of activities. So at least next week, it will allow us more time, one hour 30 minutes to do activities from both study units as well. Then the last week of August, we will do question and answer session. Are there any questions before we start with this week's session? Is there anything that you want to ask? Are you all good? I'm good. Thank you. In the absence of any questions, then that we can continue. We're going to look at firstly at the hypothesis testing for the mean, and later on we're going to look at the hypothesis testing for the proportions. By the end of the session today, you should be able to learn what are the basic principles of hypothesis testing that is very important to know that, and how to use the hypothesis testing for the mean to make a decision, and also how to make use of the hypothesis testing of the proportion to make a decision as well. Yes. Oops. My hearing still says confidence interval, but this is hypothesis testing with hypothesis testing. We're still going to look at two sections, hypothesis testing for the mean, and hypothesis testing for the population proportion. When it's for the mean, we need to also know that the populations that are deviation needs to be known, or it can be unknown. In that case, then it means they have given us the samples that are deviation, and how do we handle all three of them, and how do we do a hypothesis testing of all three scenarios as well. What is a hypothesis testing? Hypothesis testing is a claim that a researcher wants to prove. As a researcher, you will have a question that you want to answer, and that question you can state it in a hypothesis testing statement. Always when we want to prove something, we're always going to be using the population parameters. Therefore, it means in your hypothesis testing statement, you are always going to use the sign relating to your population parameters. Like for the population mean, we will use the mu in our statement, and for the proportion, we will use the pi for the proportion. When we state the hypothesis testing statement, now, because the researcher wants to prove something, there is always a case to be proven in a way, right? It's either you are guilty or you are not. It's either something is true or it's not. With hypothesis testing, there are those cases. With the research statement that they want to prove, or we want to test, we're always going to have an opposite of that statement. We will have two sides. We will have what we call a null hypothesis and an alternative hypothesis, which will be the alternative of a null hypothesis. Your null hypothesis is the statement that the researcher wants to prove, and the alternative is just another, or we can say it's the complement of that statement. If your researcher statement is not true, therefore, it means your alternative hypothesis will be true. The way we state the null hypothesis, which is the researcher's name, it will always contain an equal sign to it. For example, when we want to prove that the mean diameter of the manufactured bolt is 30 millimeters, therefore, it means we will say the mu is equals to 30 millimeters. We do not use the sample statistic symbol. We always use the population parameter symbol and not the sample statistic symbol. With your null hypothesis, we always begin, when we state the null hypothesis, it always begins with the assumptions that the null hypothesis is true, which is similar to what I just referred to, whether you are guilty or you need to be proven guilty or not. Always, like I said previously, just to reiterate on this, it always, in the null hypothesis, always has an equality sign. So you will notice that sometimes, when they state the null hypothesis, there's always an equal sign. They don't mind the sign of greater than or equal or less than or equal. But when we state your null hypothesis, they should always be an equality sign to it. So always, your statement will contain equal, less than or equal or greater than or equal. But generally, we can use just the equal sign statement. Your null hypothesis may or may not be rejected. So when we get to the end of the session, once you have done all your testing, then you need to make a decision. When you make a decision, you can either reject the null hypothesis or you do not reject the null hypothesis. And that's how you will state your hypothesis. What is very important in the null hypothesis is that when you make your decision and you conclude, you always refer back to your null hypothesis statement. Number two, the other thing that is very important with the null hypothesis is the statement you write on your null hypothesis statement, especially the parameter. It's very important that you use the right parameter when you are stating your null hypothesis and always your null parameter will correspond with the value of that parameter as well. Looking at the alternative, which is a complement of a null hypothesis, this is the opposite of that null hypothesis, right? If we stated in the null hypothesis that the mean diameter will be equals to 30, the alternative will say it is not equals to 30 millimeters. Always, what I also didn't mention with how we state the null hypothesis, we used a subscript O or subscript zero. For the alternative hypothesis, we use the subscript H1, some books or somewhere they use HA, some books they use HC, some books they use, yes, it's either they use HA or H1 or HC, which is the complement. Your alternative hypothesis testing always does not contain an equality sign. So it means the sign will be not equal, less than or greater than. Those are very important. These statements in your alternative hypothesis testing, they are very, very important because they will determine where you're going to find your critical value. They will determine what type of a decision you're going to be making and they will determine the type of test you are doing. Whether is it a one-tail test or a two-tail test and based on that information, it will tell you whether you do need to find two critical values. We know, we remember what critical values are. We did find the critical values in the last exercise study unit that we did with confidence intervals and it will also help us with the decision because if we're doing a two-tail test, then it will help us to know which sites are we making the decision to reject the null hypothesis and the alternative. Only the sign in your alternative hypothesis is that important to that effect. That is why in your null hypothesis, whether you put a greater than or equal or you just put an equal sign, it will not matter that much than when you do your alternative hypothesis. The statement you put there, it's very important. Now, some people might ask, what if the researcher wants to prove that it is less than? Remember, the statement that the researcher wants to prove has to have an equal sign to it. So if the researcher wants to prove less than, we're going to use the statement of the researcher in our alternative hypothesis and when we make a decision, if we go into reject the null hypothesis, we will be rejecting the false null hypothesis and those will create some errors and we will get to that just now. Your alternative hypothesis, we do not even have to worry about proving it whether it's right or wrong because we always, when we make a decision, we refer back to our null hypothesis statement. Right, like I explained, when the researcher wants to prove a less than, they say the mean diameter is less than 30, because we cannot put it in the null hypothesis, we can only put it in the alternative hypothesis testing, then when we make a decision, we are going to create an error because if we reject the null hypothesis, then we are rejecting a false null hypothesis. We're not rejecting the three null hypothesis because the true hypothesis that the researcher wants to prove, we placed it on the alternative. So we create what we call a type one error if we reject a true null hypothesis. So for example, most of the questions that you will get, you will be rejecting a true null hypothesis because if you get to the decision where you are rejecting the null hypothesis and that is what the researcher wanted to prove, then you will be rejecting a true null hypothesis. Like for example, with our null hypothesis that stated that the mean is equals to 30 millimeter. If we reject that null hypothesis, we are creating what we call a type one error. And the type one error is considered as a serious type of an error and the probability of a type one error is always going to be referred to as the alpha value or we call that a level of significance. So when we do hypothesis testing, we are always going to find that level of significance to use to find our critical value so that we are able to make a decision to see whether are we rejecting the null hypothesis or not. And your level of significance or your alpha value, it is set by the researcher at the beginning. So they will tell you that test at 95% confidence interval or test at 95% interval, you need to remember that your confidence level of 95% is the same as one minus alpha and you can find your alpha from there. Or you need to remember that a 95% confidence level is equivalent to the level of significance of 0,05. 0,05. We create a type two error if we fail to reject a false null hypothesis. So for example, like I did say, if the researcher wants to prove that the mean diameter is less than 30 millimeter and we put it in the alternative hypothesis, therefore our hypothesis testing, sorry, our null hypothesis will state that the mean diameter, if that one was less than, the mean diameter will be greater than or equal or we can just say the mean diameter is equals to 30 millimeter. And if we do not reject the null hypothesis then, then we are committing a type two error which is failing to reject the false null hypothesis and this is denoted by a beta value which is a type two error. Probability. Okay, we're now going to move into how do we then do the hypothesis testing? So we're going to look at how do we apply what we just learned now to state the null hypothesis and to use the level of significance, how do we make decisions? So we're going to look at a hypothesis testing for the mean and we're going to look at when the population standard deviation is known. Therefore it means we're going to somewhere to calculate using the Z test or we're going to find the critical values on the Z table or we're going to use Z table at some point to do all this. And we are also going to calculate what we call the Z test statistic which is what you have learned in sampling distribution and we will get to that just now. We are also later on going to look at testing for the mean when the population standard deviation is unknown when we use the T test. Remember to go find the critical value on the T table and also going to be introducing a new calculation which is similar to the Z test from the sampling distribution Z formula but using the T test. And then we're going to learn how to make a decision. Okay, so let's first start with hypothesis testing when the population standard deviation is known. You will need your calculator, your statistical table and the formula to remember this. On top of it, you need to know the steps of the hypothesis testing. And I'm going to tell you all the steps because they are very important that you know all six steps of hypothesis testing in order for you to get the questions right as well. So like I said, we're going to look at hypothesis testing for the mean and when the population standard deviation is known we know that we're going to use the Z table. And when we calculate the test statistics starting going to use to find either the probability value or we're going to use the Z test to make a decision using the Z test and the critical value we will use the Z test which is similar formula that we have learned and we worked with in study unit seven in the sampling distribution. And now we just in state of that only Z we put subscript state to show you that this is a Z test statistic which will be given by your sample mean minus the population mean divided by your standard error which is your population standard deviation divided by the square root of N. Now, the other thing before we forget always remember that your questions in the exam or assignment they might not give you the symbols. They will give you weights. You need to know how to interpret the weight into a mathematical formula or function or symbol. For example, if they ask you that it exceeds you need to know that it's greater than. If they say it's fewer than then it's less than. If they say it's not less than it is greater than or equal. If they say it's no more than it's less than or equal. If they say at least you need to know all those weights. If they say it is greater than or equal it should be easier to find the symbol that relates to that. So you need to always constantly remember all this. If you can't remember them, have them saved some way that you can always come back to them and refer back to them when it comes to the sides, right? Yeah, so now when we state the null hypothesis and the alternative hypothesis, the sign that sits on the alternative hypothesis it's very important. It tells you what type of a test are we doing and it also helps us to find the critical values which also help us to find the region of rejection for us to make a decision. So for a two tail test, your null hypothesis will state that the mean is equals to 30. Your alternative will state that the mean is not equal to 30. Immediately you put the null equal to 30 and the alternative hypothesis testing you know that you are doing a two tail test. Therefore it means you will have two regions of rejection. Therefore it means you will have to find the critical value by dividing your alpha value. Your critical value you will find it by dividing your alpha value by two because you will be splitting it into two regions of rejection. When we make a decision because now we I always like to write or draw this very same graph that you can see here. I always draw the belly calf shaped graph which is the normal distribution graph. And I highlight my regions of rejections based on the critical value that I would have found on the table. So if I use the z table I will find the critical value if for example it was for 0,95 a level of significance or sorry not level of significance but the confidence interval which means my alpha value would have been 0,05 and therefore I will take my 0,05 and I will divide it by two and I will get 0,0250 and I will go to the table to go find my critical value of 1,96. When I find that critical value I'm just gonna use it 1,96 and it will be on the negative side it will have a negative and on the positive side it will have a positive value and this will be my region of rejections. Anything that falls above or below so this side it will be below the critical value I'm going to reject anything that falls above the critical value I'm going to reject. So when we come to the decision this is very important because it helps you to visualize where your areas of rejections will be. Anything that falls in between the two critical values we do not reject. What happens when you have a one-tail test? So when you have a one-tail test it is when you have only one side of where you're going to do your rejection. So for example, if your hypothesis testing states that you're especially your alternative hypothesis testing it states that the mean is less than three therefore it means we are going to have our region of rejection in the lower side. So the sign is very important it will be in the lower side and you will see how we state the null hypothesis and the alternative hypothesis you can see you can either use greater than or equal in your null hypothesis or you can write it as your mean is equal to three and your alternative will state the mean is less than three as long as it has an equal sign in your null hypothesis that's right. The most important sign is what you place on your alternative hypothesis because that will tell you where your region of rejection is and when we find the critical value because it is a one-tail test and it's one-sided we're going to find our critical value at zero comma zero five and one we don't divide our critical value by two for a one-tail test it's always going to be alpha value and go find the critical value of an alpha value. When it's in the upper tail it will say it is greater than and your alternative can sorry your null hypothesis will say less than or equal and your alternative will say greater than or you can say your null hypothesis is equal to three your alternative will state greater than and then your original rejection will be in the upper tail area which means once you have your critical value of one comma nine six and on this one if our critical value will not longer be one comma nine six it will be something else at zero comma zero five you will find the critical value for that and it will you then create the origin of rejection and you will make your decision anything that falls below you do not reject anything that falls up after critical value you reject. So now let's look at how the steps now comes together. Okay, so there are six steps that you need to know and always remember and this statement or these six steps can either be the options in your question for example option A, B, C and D or option one, two, three and four can be one of the statement. So the first step of doing a hypothesis testing is to state your null hypothesis and your alternative hypothesis and I've shown you how to state your null hypothesis and alternative. Remember null hypothesis always contains an equal sign your alternative which is very important for your sign it has no inequality or it does not have an equal sign. Step number two, you need to choose the level of significance state whether is this for hypothesis testing for the mean when the population standard deviation is known or unknown you need to also state your sample size and you need to go and find your critical value that will be step number four. Okay, so you need to find your level of significance which is your alpha value. Step number three, you need to calculate or determine and calculate your test statistics. So now if you found that in step number two your population standard deviation is known then you need to find or calculate your test statistics for Z. If it's unknown you're going to use the T test statistic. Step number four, it's very important. If in step number one, step number two and step number one you did something wrong there you will get step number three or step number four wrong. Step number four it's very important to know that the sign you put in your alternative hypothesis is the correct one because it will determine how you find your critical value. In step number two, how you find your level of significance it's very important as well that you need to make sure that your alpha value is correct and whether you determine whether the population standard deviation is known or unknown because in your critical values calculation on step number four where you're going to get the critical values to determine your original rejection you will use your alpha value and the sign you got. If the sign said it's a two tail test which means it's not equal then you will divide your alpha by two and go find the critical value. If it is less than or it is greater than then you only use your alpha you don't divide it by two you use your alpha to go find the critical value. If your population standard deviation is known you find your critical value on the Z table if your population standard deviation is unknown you find your critical value on the T table and therefore it means you will need to find the degrees of freedom and the degrees of freedom you use your N minus one to find the degrees of freedom. So it's very important that you follow the steps because they link to one another and once you have determined what your appropriate test statistic is and you found your critical value the step number five says you can calculate your test statistic. So if we determined that it was a Z test then we need to calculate the Z test. If we determined that it was a T test then we need to calculate the T test. And once we done with that then we can come to step number six which is to make a decision and conclude. When making a decision we make a decision by using the critical value and your test statistic. So you need to make sure that your step number three is correct, sorry, step number four is correct and step number five is calculated correctly because then you will use both of them to make a decision. And you make a decision referring back to your null hypothesis testing or statement to say whether you reject the null hypothesis or do not reject the null hypothesis. Very careful. In the hypothesis testing for your module there are two statements that you make. You will say we reject the null hypothesis or you say we do not reject the null hypothesis. No other statement you need to make like for example we may not, we are not rejecting. The way you stated we reject the null hypothesis or we say we do not reject the null hypothesis. That is the format that you will need to use when you're stating your conclusion, right? Okay, so let's look at an example. Let's test the claim that the true mean diameter of a manufactured bold is 30 millimeter and yeah, I'm going to say at 95% confidence level. That is the case. So let's test this hypothesis. Remember our six steps, step number one is to state our null hypothesis and our alternative hypothesis. Stating the null hypothesis, our mu is equals to 30 because the statement said test the claim that the true diameter of the manufactured bold is 30 millimeter. If they could have said it is greater than then I will be doing something else. If they said it is less than then I will be doing something else because the statement said is, it means it's equal. So the null hypothesis state, the mu is equals to 30. The alternative will state that they are not equal to 30. So your mean is not equals to 30 and this because of the sign that I put or I have placed on my alternative hypothesis testing then it means I am doing a two-tailed test and that is very important because it tells me when I get to the critical value, how am I going to find that critical value? When it comes to the rejection areas, it tells me that I'm going to have two regions of rejections, okay? Step number two, specify the level of significance and your N and what you are given. For example, whether the population standard deviation is known or not. So yeah, looking at the statement, the population standard deviation is given, so it's known. My alpha value is 0,05. My N is 100, right? Step number three, finding your, or determining what type of a test is this. Based on the information, population standard deviation is given. So therefore I'm going to assume that we're going to be using our Z test because when the population standard deviation is known, we use the Z test. Step number four, determine the critical value. So now with step number four, we do the same. Remember at 95% confidence level, it's 0,05. So our alpha value will be divided by two. So it's 0,05 divided by two, which means it's 0,0250. We go to the table to go look for 0,0250 inside the table and we go out, it's on 1,9 and we go up six. And therefore our critical value is 1,96. And because it is a two-tail test, we're going to find plus or minus because it will be on the negative side and on the positive side. And immediately from here, you can draw your graph and say they will be my regions of rejection. So anything that falls here will be rejected. So this will be 1,96 and this will be minus 1,96. And there are my regions of rejection. Anything that falls here, we're going to reject. The null hypothesis, anything that falls here, we're going to reject the null hypothesis. So now we need to find our Z test. Before we can say we are rejecting the null hypothesis step number five, we compute the Z test statistic. So our Z of the sample mean minus the population mean divided by the population standard deviation divided by the square root of N, which gives me our sample mean is 29.84. And our population mean it's always stated in the hypothesis, so it makes it easier. There it is. It's stated our population standard deviation was 0,8 and our N of 100, square root of 100 and we calculate this and we find that our Z test statistic is minus 2.0. So where is minus 2.0? And we know that here in the middle here, it's zero. So minus two will fall some way inside the shaded area. So it will be some way that side because it's minus two, your numbers increase and you go to the left in terms of negative numbers, in terms of positive numbers, they will increase to the right. So minus two falls in the rejection area and then now we can go and make our decision. So that's step number six, step number six. There is our region of rejection based on our alpha value of 0.05, 0.05, our alpha value of 0.05 because there are two sides, we divide it by two which is 0.025 and then we go and find our critical value of minus 1.96 and positive 1.96 and we create our region of rejection and we found that our test statistic is minus two therefore it falls in the rejection area and we can say our Z test of minus 2.0 is less than minus 1.96. So the test statistics is in the rejection area and we can conclude by saying since the Z test is equals to minus 2.0 which is less than the critical value of Z minus 1.96 we reject the null hypothesis and conclude that there is sufficient evidence that the mean diameter of a manufactured bold is not equals to 32 and that's how we make a decision. Let's look at another scenario when we look at rejecting the or doing the hypothesis testing for Z when the population standard deviation is null now here the catch is that we are going not to use, we are not going to use the critical value and the test statistic like we did here but we're going to use the p-value. Remember what the p-value is? The p-value is your probability value that is the value you find inside the table like your alpha value. You said it's the probability in the table. The p-value will also be the probability we're going to find on the table using our Z test statistics. So it means this answer here which is our Z test statistic value we're going to use it as our Z value on the Z normal distribution table in order for us to find the p-value and this is only applicable for Z hypothesis testing only when we do Z test hypothesis testing. So later on when we do proportions because we also use the Z we can find the p-value or we can make conclusions based on the p-value. So now how do we do that? So when we make a decision using the p-value if your p-value is less than the alpha value we reject the null hypothesis. And if it's greater than or equals to alpha value we do not reject the null hypothesis. So always remember if p-value is lower the H naught must go. The null hypothesis must be rejected. Okay, so how do we do this? Also we have the five steps that you, the four steps you know of and then we edit the step where you just need to go and find the p-value instead of finding the critical value. We remove the critical value step. So you still do, you can still state your null hypothesis and alternative hypothesis. You still need to know what your level of alpha is because we're going to use our alpha value or our level of significance to make a decision and you need to know what your sample size is. You need to know what the test statistic is and how you calculate it. So we only state here that it's a Z test statistic and then you calculate the Z test statistic. And once you have calculated your Z test the answer of your Z you're going to use that to go find the p-value. Now what is very, very, very important as well here there are two things. If our alternative hypothesis says two-tail test how we go find the p-value? There are two of them. So we're going to find the p-value but you're going to add them, multiply that by two. The value you find on the table you're going to multiply it by two. If it's less than or greater than the value you find on the table will just be your p-value, right? Here's the catch. Remember how we dealt with normal distribution questions. If the alternative hypothesis, right? If the answer there is less than then it means your p-value will just be the value you find on the table, right? Maybe that's good, that's great, that's perfect. If it is greater than, always remember will be one minus the value you find on the table because remember that the table values are always the probability of Z less than because our p-value is a probability we always need to keep that in mind. Now coming to the place where it is not equal where you have to take both two p-values and add them together, you need to pay attention. If your Z-value is positive, let's start with negative. If your Z-value is negative, if it's negative, if your Z-value is negative then you can say two times the table value. That will give you your p-value. If your Z-test, if your Z-value is positive you're going to say two times one minus the table value. And that's how complex it is when it comes to the p-value. But if you can get this right, you can get everything correct. So these are the ways that you're going to find your p-value and make a decision based on that, right? Always remember that, always, always. Take a picture, take it, memorize this because when you do your practice examples and you need to be able to know all this, okay? And then the last step, we make a decision and conclude. So we're going to use the same question that we had or the same example. I'm not going to go through each statement again. The same way you state your null hypothesis and alternative, we know that we're doing a two-tail. So therefore it means our p-value. We're doing a two-tail p-value. If it's negative, we're going to just take the value and the table multiplied by two and what is your angle? If it's positive, then we're going to do all these other calculations in between, okay? So we specify alpha value because we need that. We remember in our conclusion, if the p-value, if it's less than alpha, we're going to reject the null hypothesis. So it's going to be very important because our rule states that we need the alpha value, okay? And we assume that the population standard deviation is known because they told us and we're using the Z test and we calculate our Z test and we did find that our Z test is minus 2.0. And then, before I come to that slide, let's wait right here. So because it's 2.0, so what did we say when it is minus, it's minus, right? The value we find on the table, we're going to multiply it by two. So we need to go to the Z table and we'll find minus 2.0. So we come here, minus 2.0 and zero at the top and the answer is 0.00228. So this is only on one side and this must be applied on both side. Remember, our critical value, we say this is, not this, this is minus two, sorry, positive two and minus two on this side and we found that this probability here is 0.0028, right? Oh, 228. Um, 0.228 and 0.0228. So because there are two of them, we just going to say two times 0.0228, which will give us our critical, our p-value. So our p-value, our p-value will be the combination of the two, the multiplication of that. So let's see two times, what these two times? 0.0456. 0.0456 and that is our p-value. You can say two times that or you can say 0.0228 plus two. 0.0228, it will also give you the same 0.046. They will give you the same thing. And that's what we do here. So you can say two times or you can say p-value. It's 0 plus, 0.028 plus 0.028, or you can just take the value you find on the table, multiply it by two and that will give you your p-value. And then we can make our decision. Since the p-value of 0.0456 is less than our alpha value of 0.05, we therefore reject the null hypothesis because there is sufficient evidence to conclude that the mean diameter average, E or the average diameter of a manufactured bold is not equals to 30 millimeters. And the same conclusion that we use or we found when we were using critical value and the Z test is the same as when we're using the p-value and the alpha value. So you can for only for Z only, this is only applicable when we're using the Z test. We can use either the critical value and the Z test to make a decision or we can use the p-value and the alpha or level of significance to make a decision. Now, let's move on, unless if there are any other question. I had an exercise, but based on the time, I'm thinking now, okay, let's take these five minutes to do this exercise and then we will move to the, when the population standard deviation is unknown and then we will do the proportion. So in this exercise, if in a sample of N of equals to 20, selected from the population, so the sample of 20, the sample mean of 58 and the population standard deviation of 12, suppose that the E Twitter wants to test the following hypothesis. The null hypothesis, which states that the mean is equals to 55 versus the alternative, which states that the mean is not equals to 55 at alpha or at the level of significance of 5%. Which one of the following statement is incorrect? To start with, we just need to highlight what we're given so that it makes it easier. So I'm given N, I'm given the sample mean, which means it's my X bar, the population, oh, there we go, that is my sigma, my population standard deviation is known. I can make reference to that right now, is known and my hypothesis testing, in the hypothesis testing, I'm given the population parameter, which makes life easier and my alpha value is 0,05. Okay. Now, I'm not gonna look at the options. I'm going to the hypothesis testing step by step. So step number one, we state the null hypothesis and the alternative hypothesis. I don't have to state that because they already did that for me right there, right? If they didn't, I would state the null hypothesis and the alternative hypothesis. And looking at my alternative hypothesis, I know that I am doing a two-tail test, right? That's what I know. Number two, step number two says, state what else you're given in terms with relation to your alpha, which is 0,05 and your N of 20. And I know that my population standard deviation is known, right? Step number three, if my population standard deviation is known, then it means I'm doing AZ test statistic, right? Because my population standard deviation is known. Step number four, step number four was finding the critical value. So now let's go find the critical value. So finding the critical value, we go into find the critical value by using Z alpha of two, which means it's Z of 0,05 divided by two, which is Z of 0,025. Zero, and I know that this is 1,96 because we used it previously. I don't have to go and show you again, which is that value, 1,9 and at the top six. So it's the same thing. So that is my critical value. And step number five, and on step number five, then I need you guys to help me to find the answer because I didn't open my calculator today. So we need to find Z equals the mean, sample mean minus the population mean divided by, the population standard deviation divided by the square root of N. Now I'm going to take a detour a little bit because I can see that I'm asked to find the standard error. So I'm going to ask you guys to calculate this manually and give me the answer for the top and the answer for the bottom with this exercise. So at the top, our mean is 58 minus our population mean is always stated in your hypothesis testing, which is 55 divided by our standard deviation is 12 divided by the square root of N is 20. Now I want you to give me the answer for the top patch. 58 minus 55 is three. Then at the bottom, June 12 divide by the square root of 20. 2.68. 12 divide by 20, square root of 20 is 2.68. How many digits? You must not cut off. 6, 8, 3, 2. 3, 2. Does it end there? No, there's quite a lot. Yeah, but you are cutting me. Like I want all the digits. I want to know point 6, 8, 3, 2, 8. Then it means if we leave it, yeah. If we leave it to four decimal, then it will be 3, 6, 8, 3. Because I'm looking at the answer here, it's four decimals. So you need to pay attention to the information given to you to leave your answer at the end relating to the number of decimals that you have, right? Okay, so then let's calculate this and find the actual. So just take three divide by that value. 1 comma 1180 comma 1180. There. Right, so that is step number five. Step number six, we need to make a decision and making a decision we can make, draw our normal distribution graph and we have our critical value, right? It was 1.96. So 1.96 and it will be negative on this side. And on this side, it will be 1.96 positive. Anything that falls this side, we're going to reject anything here. We're going to reject. And otherwise, if it falls in the white area, we do not reject. So now let's go and find out. So based on this information that we have, number five, our critical, our Z test, or maybe I forgot to also put the stat. You can also put stat or you don't have to put stat there. So whether it's 1.114, it falls in on this side, right? And they do not reject area, right? Because this is 1. 1.96 and this side, it's minus. And if I have a zero at the big, here in the middle, then it will fall somewhere on the side of zero, on the right hand side of zero, still in the do not reject area. So to reject the null hypothesis, and we can blah, blah, blah, blah, from then on at the level of significance, blah, blah, blah. So that is based on the critical value, right? Oh, we can also base the decision on the P value. So I'm taking it one step because we don't have the P value there, but I'm just taking it one step. So we have our Z, we can go and find, and because it's positive to go find the P value. So our P value and we're doing a two-tail test, this is positive, then it means we're going to say two times one minus the value we're going to find on the table. So on the table, we need two decimals. So it will be 1.12, right? So we go and find one on the positive side of the table. We're looking for 1.1 and at the top, it should be two because we're looking for 1.1, 1.2, where they both meet, which is 0.86861 minus 0.8686. What is the answer? 0.2628, oh, sorry, I'm multiplied by two already. You already know it's five? 0.2628. 0.2628, okay? So our P value, remember the rule, the rule says P value, if it's less than alpha, we reject. That was the rule. So our P value is 0.2628, which is greater than 0.05, therefore we do not reject. You can see that the same results, we do sign, the same results. So now we can come to the question and answer. Which one of these statements is incorrect? So number one says we're using a Twitter test. That's correct, because we did determine that it's a two-tailed test. Number two says the standard error is 2.836. We did find that standard error. Remember that this is your standard error, right? So our standard error was 26833. Our test statistic is 1.180, we did find that it is 1.118. Zero, number four, H naught is rejected. We say we do not reject. So therefore this is the incorrect statement. The critical value is 1.96, which means that is correct. As you can see, yeah, I'm just demonstrating to you to say all six steps, because we used all of them, we used that step, this step, this step, and this step. So you need to know all the six steps of hypothesis testing in order for you to answer the question, because if this was a question in the exam, then you need to be calculating all six steps in order for you to find which one is incorrect or which one is correct. And that is hypothesis testing for the mean when the population standard deviation is known. I just demonstrated as well how do we find the p-value when we get the answer of a positive, right? Okay, now let's move on to hypothesis testing for the mean when the population standard deviation is unknown. Are there any questions before we continue? Thanks, no questions. Then we can move on to the next one. Thanks, so with that hypothesis testing for the mean when the population standard deviation is unknown, we use the t-test statistic. And it's similar to the z-test statistic. Remember the z-stat, it was the population mean minus, or sample mean minus the population mean divided by the standard error. And because we had the population standard deviation, you can see that since we are not given the population standard deviation, we will be given the sample standard deviation, therefore we're going to be using the sample standard deviation there. So that's the only difference. The formula is the same. The other thing that will be different is how we find the critical value. Okay, so we're also going to follow the same six steps. I'm not going to repeat them, we've touched on them. And this is an example. The average cost of a hotel room in New York is said to be 168 grand per night for to determine if this is true. A random sample of 25 hotels was taken and the result in the mean of the average the sample mean of 172 grand 50 and the standard deviation of 15 grand 40 test the hypothesis at alpha of zero comma zero five. Now, you need to make sure that you know what you are given by reading the question again so that you understand it's there. So yeah, it says the average cost of a hotel in a room is said to be 168. They didn't say it is less than it is greater than those key weights are very important when determining the sign you will put in your alternative hypothesis. And because none of those kind of weights are used we're going to assume that this is a two tail test because then it's an equal and our alternative will be not equal. And this is how we will state our null hypothesis and our alternative hypothesis based on the statement given. So we're going to be doing a two tail test. So the first thing we do so because they also gave us, oh wait, let's go back our N, N of 25, we are given the mean of 172.50 of 172.50, we are given S which is the sample standard deviation S of 1540 and they are asking us to find this at alpha of zero comma zero five. So that is very important information that we have. So now let's do our six steps of hypothesis, step number one stating the null hypothesis and alternative, step number two state what you are given and also calculating the degrees of freedom because we know that we're going to use that in our critical value. So our degrees of freedom, it's N minus one which is 25 minus one, it's state 24. Our population standard deviation is unknown. So we're going to be using T test and this is step number three, step number four we need to go and find the critical value. So finding the critical value remember we use alpha and the degrees of freedom and because we're doing a two-tail test so it will be alpha will be divided by two. So that will be zero comma zero two five zero and that is why the critical value there is zero comma zero two five and 24. Remember to go to your T table, critical values of T and 24 and remember to ignore the top part only the values closer to the table are the values that we are using. So you go to 24 and zero comma zero two five where they both meet and that will be your critical value of two comma zero six 39, which is our critical value and we calculate our test statistic which we substitute the value the mean is 172.50 minus the mean the population mean which is always given in your hypothesis testing which is 168 divided by the standard error of the sample standard deviation divided by the square root of 25 which then the answer gives us one comma four six and because we have our critical value we can create our region of rejection and our 146 will fall within they do not reject area because our critical values are minus 2.06 and minus and plus 2.06. So 1.46 falls in there do not reject area and we can conclude by saying we do not reject the null hypothesis and there is insufficient evidence that the true mean cost of every of different the two mean cost of the hotel is different from 168 and that's how you do a hypothesis testing when the population standard deviation is unknown. I do have for the upper tail. So this one is another example. So phone industry manager thinks that the customer monthly cell phone bills have increased and now average is over has increased and it averages over 52 rent per month. So over it's greater than and that is what the researcher wants to prove. The company wants to test this claim. So now because it says over it cannot be on their null hypothesis it will be in their alternative hypothesis. So then we will create a false null hypothesis and because it is a over it will be greater than. So our null hypothesis we can write it this way or you can just leave it as equal it will still be the same. So your null hypothesis will state that the mean is equals to 52 rent or is not over 52 rent and the alternative will state that the mean is over 52 or it's greater than 52. And we can state what then alpha value of zero comma one zero. Sorry, I've been talking a lot. My throat now is not responding. Just give me a second. Okay, so we are given the alpha value of zero comma one and our end of 25. We know that we can find the degrees of freedom which will be 24. So our degrees of freedom will be 25 minus one which is 24 and because this is a one tail test remember we only have greater than. So it will be in the upper side area. So our alpha of zero comma one zero we go to the critical value table and we're looking for 24 and zero comma one zero where they meet and that will be our critical value is one comma three one seven eight and that is our critical value of T24 and zero comma one zero which is one comma three one eight one seven eight. One seven eight. So which is one seven eight. That's what we found with me, one seven eight. That is our critical value. So from our region of rejection critical value we decide the site will be with our rejection area and anything that falls in the wide area will be do not reject area and we then now can go and calculate our test statistic using the information provided and we calculate our test statistic and we find that it is zero comma five five. Now remember the table, the critical value we found was one comma three one eight from the table and now our test statistic is zero comma zero five and therefore we can determine where it will fall and it falls in the do not reject area and we can conclude we do not reject the null hypothesis since the test statistic is equals to zero comma five five which is less than or equals to the critical value of one comma three one eight. Therefore there is not sufficient evidence that the main bill is over 52 rent and that's how you make a decision. I also have an exercise. My worry is if I do this exercise we won't be able to do the proportions. Let me get your feeling. Do you want us to carry on up until five that my throat now is refusing and it's fighting with me? What are you take? Must we continue until five? No response. So I'm not gonna do the exercise. We'll just move on to the proportions because we only left with 10 minutes. So the hypothesis testing for the proportions. With the proportion we only going to deal with when the your expected mean or your expected mean or your variance is more than five. So in your module you don't have to worry about the others. So you just need to worry about doing hypothesis testing for the proportion you don't even have to test that scenario, the assumption. So we're going to use for every hypothesis testing for the proportion we're going to use the Z test statistic. Also the Z test statistic that you have learned in the sampling distribution study unit. We're going to use it here and call it a Z test statistic. So also remember like with the previous ones if you are not given the sample proportion you will be given observation that satisfy that sample and you can calculate the proportion. So you should be able to calculate your P by using your X divided by N. And our standard error we're going to go back. Remember in confidence interval we were using the standard error using the sample proportion to calculate the standard error and going back to sampling distribution study unit seven where we use the population proportion to calculate the standard error. Right. Yes, you get an example. A marketing company claims that it receives 8% response from its mailing. To test this claim a random sample of 500 were surveyed with 25 responses. Because that the alpha is equals to 0,05 level of significance. Now what are we given here? We are given the population proportion and we are told we are given the population proportion because the claim is that they're receiving 8% of responses back and they did their random sample from the 500 which is our N. They had the response of 25 which is the X and the alpha value of 0,05. And to test this claim, the six steps of hypothesis testing. The first one we state the null hypothesis and the alternative hypothesis. Step number two, we're going to state the alpha value and the sample size. We're going to determine the test statistic and the sampling distribution. You're going to find the critical value from the Z normal distribution table and decide where your rejection area and non-rejection areas will be. We're going to compute your Z test statistic and we're going to make a decision and conclude. You can see that all the hypothesis testing that we just did go through, they apply all the same steps. So you need to know all six steps of hypothesis testing. So because yeah, we also dealing with the Z test, you also need to remember that you can be asked questions to also use the P value for making a conclusion and the decision. So now let's test that. The first step, state in the null hypothesis and alternative, the mean, the proportion, population proportion is equals to zero comma zero eight. The alternative population proportion is not equals to zero comma zero eight. Therefore, we're doing a two-tail test. Our alpha was zero comma zero five given and is 500 P. We were told that we have 25 out of 500 and we calculated it was zero comma zero five. Critical value because it's alpha of zero comma zero five and we're doing a two-tail test. Our critical value will be one comma nine six because it's Z alpha over two, which is Z of zero comma zero two five, which is one comma nine six. Our origin of rejections, we identified them. We can then calculate our test statistic. Our P was zero comma zero five. We calculated it because it was 25 divided by 500. Our population proportion was given in the null hypothesis statement is zero comma zero five. Calculating the standard error and the answer we get for the test statistic or substituting the values for your standard error and calculating if I'm there, Z test is minus 2.47. We can then make our decision and conclude whether it's minus 2.47 fall. It falls in the rejection area on the left-hand side and therefore we can state that we are going to reject the null hypothesis at alpha of zero comma zero five and conclude that there is sufficient evidence to reject the company claim of eight percent response rates. And that is how you state your hypothesis testing for the proportion. If we needed to do the rejection, the decision based on the P value, then then we're going to use our Z test statistic of minus 2.47 and go to the Z values and look for minus 2.47 and that we will find zero comma zero zero six eight. And based on that information of zero because it's two side, we can then add them together or we can multiply by two and that will give us zero comma zero one three six and our P value is less than alpha value. Therefore we reject the null hypothesis. Okay, in the last three minutes, we can look at this example. We'll go through each step by step and tell you each question. Mava to randomly select a sample of hundred children with ASD and found that only 70 of them are in special needs school. So our sample N is hundred and our X is 70. But Kali and Mava to are at it once again. This time they want to determine whether the true proportion of ASD children in special needs school in the population is 0.75, which is our population proportion pi. Assume at alpha of zero comma zero five level of significance, which one of the following statement is incorrect. Now, reading the question and the statement, they would just want to determine whether the true proportion of children in special needs because it's just direct, then it means it's an equal. The null hypothesis will state that the proportion is equals to zero comma seven five. Your alternative will state that it is not equals to zero comma zero seven five. Therefore, this statement is correct. Number two, finding the critical value because we're doing a two tail test and this is a two tail test. So it means our alpha divided by two will be zero comma zero five divided by two, which is zero comma zero two five zero. By now, because we have been doing this forever, I know that it is one comma nine six. And therefore the critical value here is correct. Step number three, the value of your test statistic is minus zero comma minus one comma zero nine. So let's find that Z that is equals two. Your small p minus your pi divided by the standard error, which is your pi times one minus your pi divided by n. Our p is 70 divided by 100, what is 70 divided by 100? 0.7. 0.7. 0.7 minus 0.75 divided by the square root of 0.75 times one minus 0.75 divided by divide by our n is 100. You can calculate the whole of it. What do you get? I get minus 1.54. What do you get? Same here. You also get minus 1.54. Yes, I also get minus one. Therefore that one is equal to minus 1.54. So that one is equal to minus 1.54. So that one is equal to minus 1. Therefore that one is incorrect. And they say the p-value is zero comma 25. We can double check that as well. So let's go and look for the p-value. And the p-value we use, the value we found. What do you get? One point? Sorry, I think I'm writing it all wrong. Minus 1.154, right? 1.54. Yes. It's equal. Minus 1. So we can leave it as minus 1.15. So we go to the table and look for, remove all this. Minus 1.15. Minus 1.1. And at the top, we're looking for five as our last digit. And that is 0.125. 0.125. So our p-value, because it's a two-tail, our p-value is equals to two times, forgot, from 51. 0.1251, which is equals to? 0.2502. 0.2502, which means that is correct. And that's how you will find your p-value. And the last one says we do not reject the null hypothesis. So we can assume that the rule says, if the p-value, so because this is the rule, right? That is the rule. It says if the p-value is less than the critical value, we reject the null hypothesis. Our p-value is 0.2502. Our alpha-value is 0.050. So it is greater than, therefore we do not reject because the rule says we reject the null hypothesis if the p-value is less than that. So we do not reject the null hypothesis that is true. Otherwise, we could have used the critical value. And our critical value is 1.96. 1.96 and 1.96, this side is negative. And we look at our z-value is minus 1. It falls in the do not reject area as well. And that's how you do the hypothesis testing. Likewise, on the notes, I did include some extra additional questions for you to practice and go through the same content. So we do have exercise one where you can look at some of the information from there. And exercise two, you can take a screenshot of them and exercise three, I think they're about six exercises. Exercise four, exercise five. You can always, if you are using the video, you can always pause and do the exercise and then move on to the next one. And then the last exercise was exercise three. So we must exercise six, which deals with proportions. And that concludes today's session. Let me go rest my throat. Thank you for coming through. Are there any questions or comments? If there are none, then... Thank you, thank you, Lizzie, thank you. I have a lovely weekend. There we go, have a lovely weekend. Oh, evening. That's harder, like that. Thank you, bye.