 Good morning. Oh, is it afternoon? Good afternoon. We're going to start just now because the session today is going to be very long with all the calculations that we're going to be doing. And I think we have about 25 questions to go through. So I'll just start the session. Welcome to your 24th session. Today we're going to do activities relating to Chi square test that we did the previous sessions. So just to recap so that we can refresh our minds before we start with the activities for today. What you learned on Wednesday was how and when to use the Chi square test for contingency table where we calculate Chi square test for independence. We know that with every Chi statistic or a Chi hypothesis testing that we do, there are several steps that you need to know and do in order to get to the final step where you make a decision. We usually start with stating the null hypothesis and alternative hypothesis. We define what we are given to help us make the decision in terms of the level of significance in terms of finding the critical values and with the Chi square in terms of calculating the expected values. Followed by the next step where you need to calculate your test statistic, which will be your Chi square test statistic. And once you have the answer for that, you can then make a decision based on the critical value and the test statistic. When stating the null hypothesis and the alternative hypothesis for Chi square test, we always need to know that in your null hypothesis, you always state that two variables are independent. Alternative will state that two variables are dependent. With Chi square test, we use the contingency table because contingency table has the rows and the columns. You put your data into those rows and columns so you will be testing the relationship between two variables. So when we calculate the test statistic, we use the formula, which is the sum of your observed value minus your expected square divided by your expected. Making a decision based on this, we need to find the critical value, which we will discuss later on, I'm not going to give now. Then the other thing, because you need the expected value, you will be given on the contingency table the observed value. You need to use your observed values to calculate your expected values. To calculate the expected value, we use the row total multiplied by the column total divided by the grand total. So it means if your contingency table does not have the totals, you need to calculate those totals. Making a decision based on the test statistic and the critical value. So to find the critical value, we need to go to the critical value table of Chi square table. In order to find the critical value, we use the degrees of freedom and the alpha. So to find the critical value, we use Chi squared alpha and the degrees of freedom. And the degrees of freedom is your number of rows minus one times the number of columns minus one. So once you have your alpha value, when you go to the table, you will use your alpha value and your degrees of freedom where they both meet. That will be your critical value that you want to use. And once you have the critical value, then you take your test statistic that you calculated and make a decision. If your test statistic is greater than your critical value, we reject the null hypothesis. Otherwise, you can also draw for yourself a graph for a Chi square test because we know that a Chi square test is a right skewed test statistic which is also what we call a skewed distribution. And we can also say it is a positively skewed distribution. So when we have our critical value, we use the critical value to define the region of rejection. And our region of rejection, it will be your critical value of alpha and the degrees of freedom will determine if it falls on this side. If your test statistics falls this side, it falls in the rejection area. Therefore, we're going to reject the null hypothesis. If it falls on this side, it falls in the non-rejection area. So we will not reject the null hypothesis. And then once you have made a decision, then you can conclude and your conclusion, you always relay it back to the hypothesis. Also looked at an example of mill plan by student where we were given the observed values. Then we stated the null hypothesis and the alternative. We stated that the mill plan and the class standing are independent. The alternative stated that they are dependent. We went on and identified what we're given and calculated the expected values. Remember to calculate the expected value for 24. Means we use the row total, which is 70 times the column total, which is 70 divided by 200. Which then will give us 24.5. Calculating the expected value for 22. We will use the row total, which is 60 times column total, which is 70 divided by 200, which gives us 21.0. Calculating for 10, the expected value for 10. We say the row total, which is 30 times column total of 70 divided by 200, which gives us 10.5. And you can do for all observed values. And once we're done, then we are able to calculate the test statistic. By taking the observed value minus the expected value squared divided by the expected value. For all the values of your observed and the expected frequencies. And you get the answer that you have. Then you go to the table and look for the critical value. And knowing that if our alpha was 0.05, our degrees of freedom of, there were four rows. One, two, three, four rows excluding the total four rows and three columns. Therefore, four minus one, three minus one gave us the degrees of freedom of six. Taking your degrees of freedom of six. And your alpha of 0.05, where they both meet on the table, you would have gotten 12.592. And that would have been your critical value. And using that critical value and the test statistic, you can then make a decision. Drawing in the graph, we know that our test statistic was 0.7. And our critical value that we found on the table was 12.592. So we draw our region of rejection, which is the take wise color. And we look at our test statistics of 0.79, whether it falls in the do not reject area. And in conclusion, we can say our test statistic of 0.709 is less than our critical value of 12.592. We do not reject the null hypothesis and conclude that there is sufficient evidence that the meal plan and class standing are related at alpha 0.05. We also looked at other examples. You said there is sufficient, but you're always just saying there is not sufficient. There is not sufficient. Okay. That the meal plan, because we're rejecting the null hypothesis. Sorry, we do not reject the null hypothesis. So remember your null hypothesis says they are related. Sorry, what am I saying? The null hypothesis says there is no relation. So if we're rejecting that, therefore it means we are saying that they are not related. Okay. Okay. So I think we ended up doing this. This was the last activity that we were doing. We also shared with you the Excel sheets that you can use to calculate the test statistic. So that Excel sheet does not replace anything else other than assisting you to only calculate the test statistic. So we're going to continue doing that because most of the questions today will also ask you to calculate the test statistic, but do not forget that there are other things that you also need to remember how to find the critical value, how to state the null hypothesis and how to state your alternative hypothesis. So let's start. This one, we did it together. We can just go through it again just for us to remember how we do the questions. Which one of the following statement is incorrect? At alpha of 0,05, the critical value test is 9,48. We went to the table and first needed to calculate our degrees of freedom, which we know that there were one, two, three rows, minus one, times one, two, three columns, minus one, it's a three by three contingency table. And it was two times two, which is equals to four. So to get this, we went and look for 0,05 and four degrees of freedom. If you look at the critical value table, I'm going to share it just now. We know that we're looking for the degrees of freedom of four and our alpha of 0,05 where they both meet. That is the critical value that we are looking for. So that was correct. The null hypothesis says that the bias age is independent of car size, but since they say independent, that is correct because every time in your, in your null hypothesis, it should state independent. Calculating the chi-square test using our Excel sheet that we, whichever one you prefer to use, the one that Alistar shared or this one. So if you look at the first example that we did, that's what the example that we used, I had already populated the answer for that one. We calculated a three by three contingency table and we calculated the values. So this way that our observed values and then we calculated the expected values by using the formula, your row total, your row total times your column total divided by the grid total for all of them. And once done that, then we started calculating the expected frequency test statistic which says you observed minus your expected squared and that is why I am multiplying the same by itself. Or we can, instead of multiplying it by itself, you can just say to the power and raise it to the power, to the power of two, you will still get the same answer. And then once you have all the values, we add all of them to get a sum of all of them will give you your test statistic. And that is 14.62 minus 14.62, which is the correct answer. Number four, the degrees of freedom. We have our degrees of freedom, which is four. Step number five, it says the null hypothesis is not rejected at alpha 0.05. Now 0.01. Now, yeah, it's different to that one. So you cannot use this critical value. So it means we need to go and find the critical value at alpha 0.01 and the degrees of freedom of four. So we need to go back to the table and look for 0.01 and four. And that is our new critical value, which is 13.13.7. Therefore, we can draw for ourselves, we can draw this and define our critical value to say our critical value was 13.7, 2.7, 13.277. That is our critical value. We look at our test statistic. Where does it fall? It falls in the rejection area because it's 14, it might be somewhere there. So therefore we reject the null hypothesis. So here we need to reject the null hypothesis. The last statement says the null hypothesis is not rejected. So that will be the incorrect answer. And that's how you will answer the questions. You will find the question by looking at all the statements. Your next exercise, when you have your answer, you can post on the chat. They're asking you to calculate your chi-square state, which is the sum of your observed minus your expected squared divided by your expected. Elizabeth, just now. Give me two minutes. I've got it delivered outside. Okay. Do we have an answer? Yes, it's number three. It will be number three. Yeah, the Excel is very nice. Very nice. I'm saying the Excel is very nice. So if you look at, it's a two by two contingency table. So if I go to the two by two and I add all the values. So I have the observed values. It calculated quickly the expected values and did all the calculation. And that is the answer that we have. Okay. So that will be option number three. A study on the mode of transport that workers used to commute to work and is associated distance covered by each mode of transport is summarized as follows. Yeah, you're given a contingency table and they're asking you to select which of this is incorrect. I think it's the same as what we just did, didn't we? Almost. But anyway, raise your exercise. I'm going to give you five minutes to go through it and then we will do the activity together. Are you winning? Yes. Are you done? No. Let me know when you are done. Are we still busy? Hello. Am I muted? No, you're not. Because I'm asking nobody, I'm sorry. Okay, let's do this. Where's my pen? Sorry, I lost my pen. Select the incorrect statement. Number one, is it correct or incorrect? Correct. Correct. It's null hypothesis, independent. It is correct. Number two. Correct. Correct. Number three. Incorrect. Yeah, incorrect. Why is it incorrect? Because yeah, they say the rejection area, we will reject the null hypothesis if the high square test is less than our critical value. If the test statistic is less than our critical value of 9.4. For the fact that they say, we will reject. We know that we will only reject when it is greater than. So that is incorrect. Number four, the test statistic. Correct. It's correct because I went and I did the contingency. It's a three by three contingency table. So I use this template and our test statistic is 0.29. So which makes this correct. And if I look at the test statistic and the critical value. If our critical value, we've found the critical value previously. Remember where alpha is zero comma. This is a three by three at four and alpha of zero comma zero. It's nine comma four eight eight. So yeah, it's nine comma four eight eight. Our test statistic, we found it was six. It is on the site. We do not reject the null hypothesis. So therefore we can conclude by saying the mode of transport is independent. Or there is no sufficient evidence that they are dependent. So that is correct as well. Exercise four. Are you done? Not yet. Yes. Just two more minutes if you don't mind. No problem. You let me know when you're done. Okay. So they're looking, this one is looking for the correct statement. Yeah. Okay. All right. Now I got it. That means you're done. Yeah. Okay. So nobody else is still busy. I think the other guys are still busy. Okay. Let me know when you, when you are done. Yeah, Dan. Continue. I'm not done, but please continue. I don't want to hold it. Everybody else. Let me know when you are done. No, no, no, no. I'm pressured now. Feel like you're under pressure when you're doing the exercise. I want you to make sure that you understand what you're doing and not expect the answers. So try it and when everybody's ready to move on, then we move on. Yeah, but the guys got it so quick. So now I'm like. Yes. I have a problem to work out or calculate the expected frequency stuff, but my only problem is the Excel. Can you maybe after this session just show us how to insert and take out extra cells to make it compatible to the questions or the exercises that we do have. Okay, we'll do that. Thank you. Let's do this. Those who are still, because I know that we're not going to have everybody waking at the same pace in this. But I want to also give you an opportunity to also try things before we give you the answers so that you can see where you went wrong on your side. That's the only way you can learn. Okay, so I got the answer now. Okay, so let's do this. So we're given. The contingency table and this is a. One to one to a two by two contingency table. We are also given that at level of alpha or level of significance of one percent, we need to determine whether the party affiliation is independent of educational level of voters. And we're looking for the correct answer. Option number one, like the null hypothesis is correct or incorrect. Incorrect. It is incorrect because your null hypothesis should state. Yes, so this is incorrect. I'm going to skip that one. Oh, no, I'm not going to skip it. Let's do that. Find the degrees of freedom. Remember it's number of row minus one times number of columns minus one. How many rows do we have? Two. Minus one. How many columns do we have? Two. Two minus one. And that will be two minus one is one times two minus one is one minus one, which gives us one. Which means that statement is correct. Finding the critical value. So we know that finding the critical value. We need to go to the table. We are told what the level of significance is. So we need to go and use. The degree of zero comma zero one and the degrees of freedom of one. So you go to the table. We delete all this. We look for zero comma zero one. And one, which will be the first. Which is. Six comma six, six, three, five. And on this one he says he stayed in, which means. It should be six comma three. Six comma six, three, five. Six comma six, three, five. Then the next question is says the observed frequency. Remember the observed are the values that you are given the observed frequency for high school and party affiliation. So high school and party affiliation B. Is 31.5. Is that correct? No. That is incorrect. Number five says calculate all the expected frequency of cell. Did not complete high school and party if affiliation A is 40. 41.25. So we need to answer that because it's the expected value. We use row total column total. Divide by N. Our total is 60. Times our column total. 1110. 110. Divide by 160. So. I'm going to go to the Excel. So because this is a two by two. This is a two by two. So you need to recognize first. The type of a table that you are using. On the template that I gave you actually, I did several of them. So I have a three by three. If you have a three by three column, a three by two, sorry, a two by two. So it's a two by two contingency or a two by three. So there are different versions on this. So depending on the column that or the question that you have, let's say you have a four by four, because on this one is only a two by two. And then you are given a four by four. Then it means you need to add some extra rows somewhere. So you need to just copy or you don't have to copy. You can just insert on there. You can insert, but we will need to adjust the calculations. I will show you when we get another question, which does not have the contingency table that we have yet. So for this question that we have, which has a two by two. So you go to a two by two contingency table, which is that one. Just need to make sure that I scroll through that. So it's visible. Easy for me to see. So you just go to the two by two and you can change the titles and I was using different titles. So you can change your titles to switch. So yeah, I can write the no high school. And yeah, it can be high school based on this. And then there at the top, it's A and B. And then I put in the values. I did this when we were still doing the exercise. So once you have inputted all the values here, there's nothing you need to do because the formulas and everything will calculate. So the correct answer for the one that we were looking for is 41.25. For that, if I copy this so that I don't get confused as well, copy and paste it on the expected values and do the same with A and B. Copy and paste on the expected values. And that is your expected values. So for 40, it was 41.25. If we were asked to calculate the test statistic, you will know what the test statistic is. Please bear in mind that you do not have to always rely on the Excel sheet. You also need to know how to complete the formulas, how to do the formula for expected value, because they might ask you questions about the expected value. So you need to know how to do that as well. So let's look at the next activity, which is... So this one also is a 1, 2. It's a 2 by 1, 2, 3, 4. It's a 2 by 4. So it means I can go to my Excel template and look for a 2 by 4 contingency table, which is the bottom one. I can make it bigger now. Let's make this one bigger. And let's hide that. So this is our 2 by 4 contingency table. All we need to do is include all these values onto here. So here we have made, we have fee made. And I can just copy that onto here. And at the top I have... I'm just going to write the abbreviation. I'm lazy to type the whole thing. Basketball, football, golf, and tennis. And then I can just put in the values. It was 24. I'll put for male first, 17, 30, and 18. And then I go to the bottom one and do for female, 21, 20, 22, 12. And everything has been calculated. So my expected values are there, calculated. I can also just copy the titles. Thank you. My expected value calculated. And my test statistic calculated. All I need to do is come here and answer the question. Just give me a sec. Sorry, somebody was playing loud music next to my house, so I needed to... otherwise then the recording might not upload because of copyright. Are we winning? Yes, almost done. Can you get to number five? They are not asking you to calculate the test statistic they are giving you. They say, suppose it is this. So you just need to use the information you are given. Are you done? Yes. Okay. Since nobody else is saying anything, therefore I'm going to assume that everybody is done. Number one and number two as well. I think it's a typing error on this paper that they had. They should have put here in front a hypothesis testing or a null hypothesis testing. I'm just going to change it to that. Is number one correct? Yes. Number one is correct. Is number two correct? Yes. Yes. Number three is the degrees of three dot three. So we know that the number of rows there are. Two. And the number of columns. Four. Four. So it will be one multiplied by three, which is equals to three. And that's why we get the degrees of freedom to be three. Critical value. So you need to go find the critical value. Alpha and the degrees of freedom. And yeah, our alpha is zero comma zero five. And the degrees of freedom of three. Degrees of freedom of three and zero comma zero five. Where they both need. Critical value seven comma eight one five. Which means that is correct. Okay. The last one it says suppose that the calculated test statistic is this three point three zero. The conclusion then it will say that. We will conclude to reject the null hypothesis. Which is H naught. So what critical value did we get? We got seven point. Eight one five. What test statistics do they have is three point three zero. Where does three point three zero lie? In the do not reject area. This says we are rejecting. Therefore it is incorrect. Here you have a two by two contingency table. You need to check the hypothesis testing. Find the critical value. Calculate the expected value for yes and B. And given the test statistics. You don't even have to go and calculate any test statistic anyway. So you can just. It should be quick. So find the critical. Oh, sorry. The expected value. I forgot to write the formula here. Your total times your column total. Divide by N. Yeah, they're asking you. After you find your critical value there. Here is your test statistics like we did with the last one. Where what is your critical value and when you reject or. Your null hypothesis and that. Don't go and use the excel sheet. Use the information in front of you. Let me know when you're done. I'm done. Thank you. You still busy. Should be quick and easy information is right in front of you. I'm done. I'm done. Yeah. Let's do this. Number one. The null hypothesis. The variable is independent or variables are independent. Correct. The incorrect answer that is correct. And the alternative. It will be correct if they. Number one is correct. Critical value. Correct. Alpha is. Zero point zero five. So you go and find. Zero comma zero five. Your degrees. Sorry, your degrees of freedom is. One is one. When you go to the table. Look for zero comma. Zero comma zero five. And one. The critical value. Because one is the first line. Three comma four. Three comma eight four one. The critical value is correct. The expected frequency of yes. And B. Yes. And B is 25. Therefore we use the row total. Of 65 times the column total. Of 70 divided by. 145. And what do you get. Three one point three seven. Thirty one point. Thirty. Seven. Thirty seven. You can say 38 because it's 3793. Okay, so which makes. That incorrect. Remember in the exam you will not go through all the statements. We just find the correct one you move on. But yeah, because we are practicing. We go through all the statements. Suppose that the critical or the calculated test statistic. They give you it's four point five four five five. The null hypothesis is rejected at five percent level of significance. We found the critical value there is. Three point. Eight four one. Our test statistics fall in there. Do not reject area and this says we are. Rejecting. It doesn't fall there. It falls in there. Rejecting area sorry my bad. It's four comma. Five something it will fall some way there. So it falls in their rejection area. So we are rejecting. The null hypothesis that will be correct. So you also need to be very careful when you answer the questions. Also in the exam to. Check first whether you need to go quickly to calculate the test statistic or every information is given. So for this purpose for this one they. The test statistics was given. So you don't have to go and calculate because the one that you calculate might be different to the one that is on the question as well. So yeah, they also give you an Excel output. Which they. They calculated, which will be almost similar to what we just did. And yeah, you have your rows, your columns, and it's a two by three contingency table. They've calculated your test statistic, which is your chi square tests. Your chi square test statistic and they gave you your degrees of freedom is two and they calculated the critical value, which is 5.992. So all information for this question are in front of you. You don't have to go and do anything fancy. The only thing that they didn't calculate here is the expected values. So let's see. Number one, we're looking for the incorrect question or answer. Since 0.033, which is our chi square test, is less than our test statistic, our critical value of 5.9. The null hypothesis of independence cannot be rejected. Remember the rule. The rule says if chi squared is greater than your chi square, the rule says if it's greater than your chi square critical value, we reject the null hypothesis. Otherwise we do not. So is this statement correct or incorrect? The p value. So now what we didn't discuss in terms of the chi square test is also you can use the p value for conclusion. Also the p value cannot calculate it manually, so you will need a statistical tool to use the p value. But remember previously when we use the p value, the decision was if the p value is less than alpha, we reject the null hypothesis. So you need to check whether that statement will be correct or not. So these are decision rules, decisions. This is a decision. It's a rule that you can use to answer those two questions. Number three, you just need to calculate the degrees of freedom. Number four, you need to calculate the or you need to identify whether that observed frequency is correct. And number five, you need to calculate the expected frequency and remember that you use your rule total multiplied by your column total divided by n. Are we done? Done. Number one, the test statistic is less than your critical value. Therefore, the null hypothesis of independence cannot be rejected. Is that correct? Correct. Number two, the p value of zero comma zero eight, zero comma eight four seven is greater than zero comma zero five. The two variables are dependent. I think this is the incorrect one. That is incorrect. Moving on, the degrees of freedom. And how many number of rows? We have two rows, two minus one. How many number of columns? We have three columns minus one. Is that correct? Yes. That's correct. The observed frequency of row one column three, row one column three is 174. That's correct. The expected frequency of row one column three is 179. Did you calculate that? The rule total is 358 multiplied by the column total, which is 2000 divided by 4000. So it's 358 times 2000 divided by 4000. Correct. You don't have to calculate for all the expected frequency. Pick and choose several of them and see if they are correct. We'll have a two by three contingency table. Which one is the correct expected frequency? Otherwise, you can also use the table. So go to the three by, how many do we have? Three by three table. Need to go to a three, two by, two by three. Two by three table, which is this one. Can just use it to see my expected. I don't have to worry about the headings. I'll just use my daily 67, 32, 11, 18, and nine. And it says my expected frequency should be 71, 27.58. So if I look at those, number one will be out, number three will be out, and number four will be out. This one they all rounded them off. So the only one that is correct will be number two. 71.58, 27.5, and 11 and nine. So you can use the Excel sheet for this one. So the answer is option two. You need to calculate the test statistic. This is a two by two. So you will have to go and use the two by two table, which is that contingency table that I put in your observed values into the wide area. And it will calculate the expected frequencies and work out. You're just going to leave it there so that I don't give you the answer. Do you have an answer? Otherwise, then it means 25, 25, 25, 25, 25. So the expected values here, change my color of my pen is 25, 35, 25, 25. So in order for us to calculate the chi-square stat, we use the observed minus your expected squared divided by your expected. So therefore you're going to say 20 minus 25 so that we don't forget that we need to use this at some point. What about for the dark? It's not a two by three contingency. Thank you. It's a three by two contingency. So we need to use this one. Thank you for picking that one up. 20 and 20. This is and this are your expected frequencies and then you do your calculation. So you'll do 20 minus 30, 20 minus 26 squared, and that will give you that answer. 8 divided by 26 will give you 1,6. 40 minus 37.33 squared divided by 37 will give you that one and so forth. And the answer is? Number five. Option five. What is the degrees of freedom? Two. Which is option number one. Find the correct answer. First, complete the table. Are we done? Others? Yes. Number one, we're looking for the correct answer. Is the null hypothesis correct? The state of the variables are dependent. Incorrect. Incorrect. It should say independent. Number two, the observed frequency for the acceptable employee, John, is 65. Did you complete the whole table? What do you think? It's 685 instead. 685. Let's quickly complete this whole table. Did you complete it? Yeah, 300. That's 35 and 15. The expected frequency of acceptable and PTA acceptable row total is 950. Multiply by column total of 300 divided by 1000. And the answer is? 285. 285, which means that is incorrect. Your degrees of freedom, number of rows minus one, number of columns minus one. How many rows do you have? Two. How many columns? Two. And the answer is? One. Suppose the calculated test statistic that calculated it is that H naught is not rejected at alpha 5%. So we know what the value of alpha, critical value at 1% alpha is 3,84. So if we know that 3,841, our test statistics falls in the rejection area. And this one says it's not rejected. So that is incorrect. To perform a square test of independence, you require two or more nominal variables. The distribution to be negatively skewed. The degrees of freedom. The level of significance at test of contingency table. Number two is wrong. It must be positively skewed. Is number one right or wrong? Correct. Nope. We can only use variables. Also it is incorrect. For a square test, we only use, we test two variables. Yeah. Do we need the degrees of freedom? Nope. To do the test? To perform it, what will we do with the degrees of freedom? Do we really, do we need the level of significance? What will we just do with the level of significance knowing that? Do we need a contingency table? Yes. Yes. That is the base of a square test contingency table. Lizzie, why are the others the degrees of freedom, the level of significance? Why are they not valid answers? For a square test, I can use this for any other test. Remember the degrees of freedom, we use it for T test as well. It's not only relevant for square test. The level of significance for any test I do, I can use that. And me, given your degrees of freedom and the level of significance, only those cannot warrant that I need to do a chi-square test. It was a horrible question. Yes, it is. It needs you to apply your mind. What is it? It's like, what is the source of water? They give you a tap, they give you a tank, and they give you rain. And they say, and they give you the cloud. What is the source of water? It's a horrible question to ask. And that's what they do in here. If this is an exam question, one more gone. Not one, four marks. Four marks gone. That's fine. Four marks gone. Yes, four marks gone. The level of income and why be it political preference, use the results shown in the table below at the alpha level of significance of 1% to test whether the political preference and level of income are independent. This is a four by three table. Do they even ask you to calculate a test statistic? No, they already calculated it. So the last thing is in the exam, they might, in the exam, they will not expect you to do a chi-square test calculation because they know that it takes forever to calculate that. So that is why they give it to you. But you just need to also know how to calculate it because sometimes they can ask you to calculate it. So you'll never know which one. So suppose that the test statistic is that, which one of the following statement is incorrect? Your null hypothesis is an alternative for hypothesis, statement number one, number two, find the degrees of freedom, which is your R minus one, C minus one, find the critical value, which is chi-square of alpha and the degrees of freedom. There are 390 people. It means you need to come to this table and calculate the totals, calculate the total to get the number. And then number five says H naught is rejected. Make sure that you make your decision. Find what the critical value is. You are given your test statistic. Once you have your critical value and your test statistic, is this statement correct? That's your exercise. Are we done? Yes. Okay. Is number one correct? Yes. Number one is correct because null hypothesis, independent, alternative, dependent. Degrees of freedom? No. Okay. How many number of rows do we have? Four. Four minus one. And number of columns? Three. Three minus one. So therefore it's three multiplied by two, which is equals to six. The critical value? Is correct. We have zero comma zero one and six. We go to the table. Zero comma zero one and six. Sixteen point eight one two, which is correct. There are three hundred and ninety people. So if you add all of them. It's correct. We get three hundred and ninety. The test statistic. Oh, sorry. The critical value we found was 16 comma eight one two. And the test statistics was 69. So it falls in the rejection area. So we reject the null hypothesis. Lizzie, just a question there. Number five, I see it's rejected, but as well it says the variables are dependent. Shouldn't it be dependent? Oh, okay. Thank you. They are independent. They made a mistake then. What do you do in that sense? No, they didn't make a mistake. We reject the null hypothesis. Sorry. No, it's correct. If we reject the null hypothesis. Then we accept the alternative is correct. So they are independent. But Liz, can I ask a question? Yes, you can. Remember with the previous section that we dealt with, you mentioned that for the null hypothesis testing would always have an equation sign, like it falls to a modern step. So with regards to these ones, would you have like an independent as the none? No, no, no. For Chi-square test, the only two things independent, dependent, no sign, no greater than or equal, no less than or equal because there are no values. We're not dealing with numerical values here. We deal with quantitative data, or quantitative variables and we test in those two variables if they are related, they are associated with one another. So yeah, the statement only states independent or dependent. No signs. Yes. What I'm trying to understand is would you have like maybe for them now be dependent and the alternative be independent? No. Always. Your null hypothesis was state independent. The null hypothesis. Like we had in the previous one where we said the sign always have an equality sign to it. Here the null hypothesis always is independent. So you should not get this one wrong. Thank you, Miss Liz. Thank you for my question. Are we done? There's not a lot of calculations to be done. Are we done? Yes. Okay. Number one. Incorrect. Correct. Correct. Number two. Incorrect. Number three. Incorrect. Number four. Incorrect. Number five. Correct. Okay. So number four, because I can hear that I don't think everybody agrees. So let's check. It's zero comma zero five and our degrees of freedom, but it's our degrees of freedom here will be three, right? Three. Yes. Yeah. Go into the critical value for zero comma zero five. And three is seven comma eight one five. Okay. And this was 15. So they eat seven comma eight one five. So yeah, we need to calculate the expected frequency of spa and autumn. Bar and autumn is that row total five, 60 column total times three, three divide by one thousand. And that is five, 60 times one three three divide by one thousand, which is one comma one eight six comma four eight, which is the correct. Okay. We left with 15 minutes. I think this we did do this question looks exactly the same as the one that we did do. So I'm not going to ask you to do that. I'm going to ask you to do this one because on this one, if calculate the test statistic, you need to go calculate the test statistic. This is a two by two contingency table. So you can do that by, let me know when we're done. I got five guys. Also by five. I use the Excel and I'm seeing the state, the test statistics, Alice is zero. And they're looking for the incorrect one. Found the same problem. Okay. We're done. Let's see how fast she runs. We were waiting for you this time. Which one of the following statement is incorrect? Number one. Correct. Correct. Number two. Correct. Number three. Correct. Number four. Correct. Number five. Correct. Incorrect. Ha. So somebody said correct. Incorrect. She's referring to number four. Oh. Number five is incorrect. Lizzie, if I may ask, if you can just go back. When we work this out inside the Excel, your expected and observed tables are identical. Yes. So they might be. So let's. So that's statistically possible because I didn't think these calculations should all, they would always be different. Not necessarily. So this is two by two. Two by two. Okay. So it's 60, 30, 30, and 50. And there we go. Now they're identical. And then the test is. Even when you take your card later, remember those are for 60, it will be 90 times 90 divided by 125. So what do you get when you calculate on your calculator? 90 times 90. Divided by 135. The answer is 60. It's just weird having an observed and expected table to look the same. Yeah. Okay. But even I can just check. The test, my test statistic is zero because your calculation will be zero minus 60 minus 60 will be zero. So that will be incorrect. Yes. Okay. I'm not sure if I want us to do this one. We can do it together. And then I could look. Then the rest of the other activities you can do on your own as your practice activities. There are about 25 questions left. Let's see. One, two, three, four, five, six. Yeah. Five questions left. So I can just take this last one and do it for you or do it with you. So we have missing information. So it's 82 plus 104. It's 186. And 118. The observed frequency for 36 and 50. 36 and 50. And newspaper different. It's 118. That's correct. The expected frequency of 50 above 50 and newspaper different, which is at this point will be 200 times 214 divided by 400. 200 times 214 divided by 400 is equals to 107. Which means that is the incorrect answer that we're looking for. Our degrees of freedom. Yeah. It's number of row minus one times number of columns minus one. Our rows, they are two minus one times the columns. They are two minus one. Therefore, the degrees of freedom is one. That's correct. Critical value at 2.25. Which means divide by 100 gives us 0.02. So we need to go find critical value at 0.025 and the degrees of freedom of one. 0.025 and the degrees of freedom of one. It's 5.024. Which is correct. If we given the test statistic, H naught is not rejected. So we can use our critical value of 5.024. And our test statistics, they say it's 4.8. It will fall in the do not reject area. So that is correct. Is it not that the critical value is different because we're at 5% for that one? At 5% you are right. The critical value is different. So let's go find the critical value at 5%. So at 5%, it's 3,8. Therefore, we have two incorrect answers here. This is at 3,812. At 5%, degrees of freedom is one. It's at 3,812. So unless they made a mistake with the percent. So our 4,18 falls in the rejection area. So it cannot be. So this one also is incorrect. So you have two incorrect answers on this question. Our test statistic is greater than the critical value. Yes, we reject the null hypothesis. It will fall in the rejection area. Remember the rule says if your chi-square state is greater than your chi-square crit, you reject the null hypothesis. This one is bigger than the critical value at 5% because our critical value is 3,8. Therefore, we reject the null hypothesis. So this statement says H0 is not rejected, which is incorrect. At 5% level of significance, we reject the null hypothesis. It was correct if this was 1%. That's why I'm saying this. I think they made a typing error there. They should have used the 1%, not 1%. What is it? 2.5%. That statement would have been correct. We have one minute left. So this one also you can do on your own already in the bracket. They calculated the expected values in the bracket. The observed values are the actual numbers. They gave you the test statistic. They give you the critical value. And you can answer all the questions that they are asking you. And on this one, because I took this, I think, from the STA 1501. So that is why 15, not 1501, 1510. That is why you have this association, not association. But in your module, you don't use the associations. We use independent and not independent. So this is, there is an association. It's dependent. And non-association is independent. Then the other one, you just need to calculate the test statistic. So this one, you can use the Excel. So you can use Excel. It's a 2 by 2 table. And this one, it's a 2 by 2 table as well. You can use Excel to calculate. You can use your Excel template to calculate the test statistic. And on this one, they don't expect you to calculate the test statistic using the same values that we got from the previous one. These are your expected values. So you can check if this is correct or any of them. A statistic, not a statistic. So you just use the table. It's a 2 by 2 and find the correct answer. They are 2 by 2 table. And here also, you can use your Excel to calculate the test statistic. Or you can use your formula. Chi-square stat is equals to the sum of your observed minus your expected squared divided by your expected. Because here are your expected frequencies. And here are your observed frequencies. You just substitute and then calculate, excluding the totals. Don't use the totals. And that concludes today's session. The next time I see you will be on Wednesday when we do regression. And any question, any comments? If there are none, enjoy the rest of your weekends. Thank you. Same to you, Lizzie. You too. Thanks. Bye. Bye. Bye. Thank you. Thanks, Miss Lizzie. Bye.