 We're going to look initially for the first 15 minutes or so or take a minute. We're going to cover the basic concepts for hypothesis testing because you need to understand those concepts in order for you to be able to proceed and answer any question relating to the hypothesis testing. Then we're going to look at testing the hypothesis testing where the population standard deviation is known. Then we'll take a 10-minute break and come back, do where the population standard deviation is unknown, and then we'll do the proportion. Then we should be done for the day. So what are the things that we need to know about the hypothesis testing? So in your module you only do hypothesis testing for one sample test. So it means we only have one population where we collect the sample from. So what is hypothesis testing? A hypothesis testing is just the claim that the researcher wants to prove. So for example, if the researcher wants to prove that COVID-19 only affects adults but not children. So the researcher wants to prove that, has to prove that so that then he knows that it only affects big people, not small children. And we always use the population parameter for the hypothesis testing because we need to test the data that comes from the population or we need to infer back the results to what comes from the population. But when we do the analysis, we're going to use the sample statistics to do the analysis. Because we take the sample data after we have manipulated it and analyzed it, we infer back the results to the population. So it is very important that we use the population parameter to state our hypothesis claims. And you will notice in your module you only do for the two, the population mean and the population proportion. Even when we state the null hypothesis or the alternative hypothesis at the later stage, you will understand we only use the population parameter value or sign on there. So how do we then claim state this hypothesis? So a null hypothesis is what the researcher wants to prove as the null hypothesis. But sometimes the researcher might want to prove something but we cannot put it in the null hypothesis but we have to put it in the alternative. And there are things that makes you do that. And those are the things like, for example, if you claim for your hypothesis testing, if we want to claim that it is bigger than. The null hypothesis, oh gosh, I what am I talking about? Maybe today I am very drunk. In the null hypothesis, there is always going to be a equal sign. Sometimes you don't necessarily have to put the sign like greater than or equal or less than or equal. It always have an equal sign. And since this is what the researcher wants to prove, it's always going to be the assumption that everybody begins with. And how you state your null hypothesis, you always use the h with a subscript zero and you use the population parameter. In the null hypothesis, you can put the equal or greater than or equal or less than or equal because in your null hypothesis, there is always an equality sign. So if this is what the researcher wants to prove, then there should be an alternative to this. And the alternative to this, we call it the alternative hypothesis. And it has a subscript one. Sometimes they, in some cases, they might put an A there to show you that this is an alternative hypothesis to the null hypothesis. With the alternative hypothesis, it does not contain an equal sign. So you will never, ever, ever put an equality sign on the null hypothesis. So it means it will be not equal, less than or greater than. And that's how you will always state your values in your alternative. And this is very important because the signs we put in the alternative hypothesis are going to help us make decisions. They are going to help us find the critical value. They are going to help us to determine what kind of a p-value we need to calculate. So the sign is very important, especially in the alternative hypothesis. In the null hypothesis, it doesn't really matter. It can just for B A equal sign, it means nothing because your null hypothesis, if I state it and say the mean is equal to 30, the alternative might be that the researcher wanted to prove that the mean is less than. If the researcher wanted to prove that the mean is less than, I cannot put it in the null hypothesis. But that will go in the alternative as a less than. So it will state that in my alternative, it will say the mean is less than 30. Oh, we can also say the mean is less than or equal, it's greater than or equal in our null hypothesis will mean the opposite of the alternative. But in most cases, we always write the null hypothesis as equal. The only important sign will be denoted in your alternative hypothesis. We also do not reject the alternative but reject null hypothesis. So with the null hypothesis, you always state that you do not reject or you reject. So we don't prove the alternative, we only prove the null hypothesis in this instance. Okay, so now I just explained something that I said. In the null hypothesis, we can always have an equal sign. So therefore, it means the null hypothesis, like I said, if it is what the researcher wants to prove. So here is my researcher, here is my researcher, and this researcher wants to prove that there is no difference between how people behave. So therefore, it means in my null hypothesis, I will have the mean is equals to if people score 100 in their test. So the mean is 100%. There is no difference in how the people score in this test. My alternative, because that's what the researcher wanted to prove, it will state that the mean is not equals to, it will prove otherwise. So that is one example. Another example, here is my researcher, but my researcher wants to prove that there is one group scores more than 80%. So the mean average, so this researcher says, okay, some test that students wrote, the average score of those test was 80%. Oh, eight. Let's make it eight. So since the researcher wants to prove that, we cannot put that in the alternative hypothesis, sorry, in the null hypothesis. Remember, this is what the researcher wants to prove. So we cannot put it in the null hypothesis because in the null hypothesis, it must have an equal sign or less than or equal or greater than or equal. It must have an equal sign, but actually what the researcher wants to prove cannot go there. And therefore, since it cannot go there, we state that the mean is 80 and we go to the alternative and we're going to prove that the mean is greater than 80. So when we do all this, we create some errors when we test the hypothesis and we want to make a decision. We sometimes create those errors and there are different types of errors. There is a type one error that can occur and a type one error occurs when the true null hypothesis is rejected. So where do I make a type one error in this instance? I will make a type one error here because that is when, if I calculate them, I find that I need to reject that null hypothesis that the mean is different. Then I am committing a type one error if I reject the null hypothesis in that statement. And that is what they consider as a serious type error and sometimes type one error is the same as your level of significance denoted by alpha. And this alpha is set well in advance by the researcher. So you will notice even when you do the exercises, it will also state that your level of significance is this or they will say your confidence interval is at 95%. Don't get confused when they mentioned the wave confidence interval. Remember we did the confidence intervals yesterday? In this instance, they are referring to the confidence level where you are able to take your confidence level and say minus alpha of that confidence level and calculate your alpha value. The other error that can happen is when you fail to reject the false null hypothesis, where does that happen? It happens here. This is my false null hypothesis. Remember, your null hypothesis is what the researcher wanted to prove. But the researcher wanted to prove that it's greater than and the greater than cannot go into the null hypothesis. Therefore, I create a false null hypothesis in order for me to continue with the test. And if I reject this null hypothesis, also if I do not reject that null hypothesis, therefore I am committing a type 2 error and it's denoted by beta as the type 2 error probability. And these are just the possible errors that can happen. Enough with the errors. Let's then now look at how do we do the hypothesis testing. There are six steps in hypothesis testing. In your exam or your assignment, you will notice that either every question might have related six steps in it or one question might have in the options that you need to answer, you will have those six steps that you have to go through. Every option on your question might be one of those six steps. So what are they? The first step of hypothesis testing is we need to state clearly what our null hypothesis is, which is the researcher want to prove, and the alternative to that. Once we know that because it's very important to state those because they guide us in terms of what kind of a test are we going to be doing? Are we going to be doing a one-tail test or a two-tail test? In that way it means if the researcher in your alternative, I'm only going to concentrate on the alternative part. If the researcher on the alternative wants to test that it is not equal, therefore it would be a two-tail test. Then it's a two-tail test. That has implication when you do your decision. Therefore it means when we go and make a decision about this hypothesis, we're going to have two regions of rejection. And if we're doing in the alternative, we have a less than or we have a greater than, then we are looking at what we call a one-tail test. And also it means if it's greater than the rejection areas is only on your right hand side. And if it's less than, your rejection area will be on only one side, on your left hand side. Now also, stating your correct null hypothesis and alternative hypothesis in this instance will also guide you when you go find the critical value. And when we do the critical value, I'll show you what I'm referring to. The next step is to state what you are given. For hypothesis testing for the mean, you will state the alpha, you will state your n. For hypothesis testing for the mean when the population standard deviation is not known, then you can also state your x observation or calculate your degrees of freedom. Sorry, you will have to calculate your degrees of freedom because then you will have your n on there. For the proportion where you are not given the sample proportion, you will be given your x observation and your sample size. You can use that to calculate your sample proportion and this thing. Step number three is to determine which appropriate test you will be doing. Like we did with confidence interval, with hypothesis testing, you also have three things that you need to worry about. Depending on whether the population standard deviation is known, you will use the z test. If your population standard deviation is unknown, you will use a t test. For the proportion, you will use a z test. And that is what you need to always remember. Population standard deviation known is a given. I use the z test. If it is unknown, I'm going to use the t test. If I'm doing the proportions, I use the z test. The appropriate test statistic and your alternative hypothesis sign, you should be able to know how to find your critical value. If I'm doing a z test and I'm doing a 2t, so let's say it's a 2t and my sigma is known, then my z critical value will be z alpha divided by 2, not t2. That will help me find my critical value. If I'm doing a t test, then I will be given alpha divided by 2. And, oh, sorry, if this one should say, if I'm doing a 2t test, but my population standard deviation is unknown, then I must use a t test. The t test, you will do t alpha divided by 2 and the degrees of freedom. And all this, they will help you to find the critical value. So what about when it is a 1t? So when it's a 1t, whether it's in the left or in the right, as long as the 1t, whether the population standard deviation is known or unknown, I'm going to just ignore that. So for example, if you're going to be doing the z, you're going to use z alpha, not z alpha over 2, just z and alpha. And for t, you are only going to use t alpha and the degrees of freedom. So it's also very important to know all this. For a 2t test, your critical value, you find it by using alpha divided by 2 for a 1t test, your critical value, you only use alpha value. Once you have found your critical value, now you can calculate your test specific. So depending on which one, the t or the z or the proportion, you will need to know how to calculate your z test. And we will look at the formula later on. Oh, sorry, before I move on, the z test or the z statistic that we are referring to here is the same z score formula that we used in the sampling distribution. So if you got lost in the sampling distribution when you were calculating the z formulas, we are continuing with that because the test statistics in hypothesis, we use the z test that we use in the sampling distribution. It's one and the same thing. Once we have calculated the test statistic, then we can make a decision. Making a decision for a 2t, it means you will have two regions of rejection. On this side, your z alpha divided by 2 on the negative or your z alpha divided by 2 on the positive. Or even if it's t, it will be t alpha divided by 2 on the negative and t divided by alpha on the positive. If it's 1t, so if let's say it's for the less than, you will only have your t alpha or z alpha on one side. If it's for the greater than, your rejection area will be your z alpha or your t alpha on site. And these are the very, very important steps that you need to know. If you miss one step, you're going to miss all the steps in between. If you didn't state your null hypothesis correctly or identify it correctly, you will get your critical value wrong. So you will get your critical value wrong and you will also get your decisions wrong because then they are all linked. So enough with what I've just said. Let's look at more examples of this in here. So if you're going to find the critical value for a 2t test, we know that we do two regions of rejection and if it falls between the two, we reject the null hypothesis. Now, here is the thing. If you look here, it always says negative and it also says positive. Sometimes they might say we want a less than value of z and the value that you get is z 1,9. And then you go to the critical value table and you find that on the critical value table there is a z of 1, minus 1,9. So if we put this as an absolute values, so if we say we calculate our z statistic for this critical value and if our z statistic is less than our absolute z alpha divided by 2, because then I have two sides of this, the rule will state that I must reject the null hypothesis at this point. Also the same thing, if I have the absolute value of z on this side and my z alpha divided by 2, the rule will state that I must reject the null hypothesis on the side as well, because for both of this side, I need to reject the null hypothesis. If it was only a one-tail test, then I do not reject the null hypothesis if it falls on the other side. So only for a two-tail test, your rejection area is in both areas. For a one-tail test, you can see them. For way it is less than in the alternative, your rejection area will only be on the left-hand side. And if it falls in this left-hand side, you reject the null hypothesis when it falls in this area. So it means for my absolute value, if it's less than my alpha, my alpha, you know, only alpha, z alpha, because I'm not dividing by 2, it's only one side. So it will just be z alpha. Then I will reject the null hypothesis in this instance, in the rejection. In the upper-tail area, it will also mean the same. If my absolute z statistic is greater than my critical value, I will reject the null hypothesis. So for one-tail test, if it's in the alternative hypothesis, it states that it's less, it's greater than. Therefore, it means my absolute z statistic value, if it's more than my critical value, so it will be bigger than my critical value, I will reject the null hypothesis. And if it's less, I do not do anything. You just need to understand those rules.