1 00:00:11,500 --> 00:00:17,380 Last time, we talked about chi-square tests. And 2 00:00:17,380 --> 00:00:21,580 we mentioned that there are two objectives in this 3 00:00:21,580 --> 00:00:25,220 chapter. The first one is when to use chi-square 4 00:00:25,220 --> 00:00:28,630 tests for contingency tables. And the other 5 00:00:28,630 --> 00:00:31,070 objective is how to use chi-square tests for 6 00:00:31,070 --> 00:00:35,410 contingency tables. And we did one chi-square test 7 00:00:35,410 --> 00:00:42,050 for the difference between two proportions. In the 8 00:00:42,050 --> 00:00:44,630 null hypothesis, the two proportions are equal. I 9 00:00:44,630 --> 00:00:47,970 mean, proportion for population 1 equals 10 00:00:47,970 --> 00:00:52,970 population proportion 2 against the alternative 11 00:00:52,970 --> 00:00:58,470 here is two-sided test. Pi 1 does not equal pi 2. 12 00:00:59,310 --> 00:01:04,210 In this case, we can use either this statistic. So 13 00:01:04,210 --> 00:01:05,150 you may 14 00:01:07,680 --> 00:01:15,520 Z statistic, which is b1 minus b2 minus y1 minus 15 00:01:15,520 --> 00:01:21,840 y2 divided by b 16 00:01:21,840 --> 00:01:27,500 dash times 1 minus b dash multiplied by 1 over n1 17 00:01:27,500 --> 00:01:31,200 plus 1 over n2. This quantity under the square 18 00:01:31,200 --> 00:01:33,080 root, where b dash 19 00:01:42,180 --> 00:01:48,580 Or proportionally, where P dash equals X1 plus X2 20 00:01:48,580 --> 00:01:55,560 divided by N1 plus N2. Or, 21 00:01:58,700 --> 00:02:00,720 in this chapter, we are going to use chi-square 22 00:02:00,720 --> 00:02:04,520 statistic, which is given by this equation. Chi 23 00:02:04,520 --> 00:02:09,620 -square statistic is just sum of observed 24 00:02:09,620 --> 00:02:10,940 frequency, FO. 25 00:02:15,530 --> 00:02:20,070 minus expected frequency squared divided by 26 00:02:20,070 --> 00:02:22,490 expected frequency for all cells. 27 00:02:25,210 --> 00:02:29,070 Chi squared, this statistic is given by this 28 00:02:29,070 --> 00:02:34,190 equation. If there are two by two rows and 29 00:02:34,190 --> 00:02:36,290 columns, I mean there are two rows and two 30 00:02:36,290 --> 00:02:40,270 columns. So in this case, my table is two by two. 31 00:02:42,120 --> 00:02:44,360 In this case, you have only one degree of freedom. 32 00:02:44,640 --> 00:02:50,440 Always degrees of freedom equals number of rows 33 00:02:50,440 --> 00:03:00,320 minus one multiplied by number of columns minus 34 00:03:00,320 --> 00:03:06,140 one. So for two by two tables, there are two rows 35 00:03:06,140 --> 00:03:11,560 and two columns, so two minus one. times 2 minus 36 00:03:11,560 --> 00:03:15,420 1, so your degrees of freedom in this case is 1. 37 00:03:16,440 --> 00:03:19,320 Here the assumption is we assume that the expected 38 00:03:19,320 --> 00:03:22,940 frequency is at least 5, in order to use Chi 39 00:03:22,940 --> 00:03:27,200 -square statistic. Chi-square is always positive, 40 00:03:27,680 --> 00:03:32,260 I mean, Chi-square value is always greater than 0. 41 00:03:34,040 --> 00:03:38,890 It's one TLTS to the right one. We reject F0 if 42 00:03:38,890 --> 00:03:42,430 your chi-square statistic falls in the rejection 43 00:03:42,430 --> 00:03:45,850 region. That means we reject the null hypothesis 44 00:03:45,850 --> 00:03:49,470 if chi-square statistic greater than chi-square 45 00:03:49,470 --> 00:03:53,130 alpha. Alpha can be determined by using chi-square 46 00:03:53,130 --> 00:03:56,490 table. So we reject in this case F0, otherwise, 47 00:03:56,890 --> 00:04:02,050 sorry, we don't reject F0. So again, if the value 48 00:04:02,050 --> 00:04:05,350 of chi-square statistic falls in this rejection 49 00:04:05,350 --> 00:04:10,280 region, the yellow one, then we reject. Otherwise, 50 00:04:11,100 --> 00:04:13,900 if this value, I mean if the value of the 51 00:04:13,900 --> 00:04:17,060 statistic falls in non-rejection region, we don't 52 00:04:17,060 --> 00:04:21,680 reject the null hypothesis. So the same concept as 53 00:04:21,680 --> 00:04:27,680 we did in the previous chapters. If we go back to 54 00:04:27,680 --> 00:04:32,060 the previous example we had discussed before, when 55 00:04:32,060 --> 00:04:36,620 we are testing about gender and left and right 56 00:04:36,620 --> 00:04:41,340 handers, So hand preference either left or right. 57 00:04:42,960 --> 00:04:49,320 And the question is test to see whether hand 58 00:04:49,320 --> 00:04:53,100 preference and gender are related or not. In this 59 00:04:53,100 --> 00:04:56,960 case, your null hypothesis could be written as 60 00:04:56,960 --> 00:05:00,620 either X0. 61 00:05:04,220 --> 00:05:07,160 So the proportion of left-handers for female 62 00:05:07,160 --> 00:05:12,260 equals the proportion of males left-handers. So by 63 00:05:12,260 --> 00:05:16,600 one equals by two or H zero later we'll see that 64 00:05:16,600 --> 00:05:22,680 the two variables of interest are independent. 65 00:05:32,810 --> 00:05:37,830 Now, your B dash is 66 00:05:37,830 --> 00:05:42,250 given by X1 plus X2 divided by N1 plus N2. X1 is 67 00:05:42,250 --> 00:05:51,930 12, this 12, plus 24 divided by 300. That will 68 00:05:51,930 --> 00:05:57,310 give 12%. So let me just write this notation, B 69 00:05:57,310 --> 00:05:57,710 dash. 70 00:06:05,560 --> 00:06:13,740 equals 36 by 300, so that's 12%. So the expected 71 00:06:13,740 --> 00:06:19,500 frequency in this case for female, 0.12 times 120, 72 00:06:19,680 --> 00:06:22,140 because there are 120 females in the data you 73 00:06:22,140 --> 00:06:25,520 have, so that will give 14.4. So the expected 74 00:06:25,520 --> 00:06:30,680 frequency is 0.12 times 180, 120, I'm sorry, 75 00:06:34,810 --> 00:06:39,590 That will give 14.4. Similarly, for male to be 76 00:06:39,590 --> 00:06:43,390 left-handed is 0.12 times number of females in the 77 00:06:43,390 --> 00:06:46,690 sample, which is 180, and that will give 21.6. 78 00:06:48,670 --> 00:06:53,190 Now, since you compute the expected for the first 79 00:06:53,190 --> 00:06:57,590 cell, the second one direct is just the complement 80 00:06:57,590 --> 00:07:03,020 120. 120 is sample size for the Rome. I mean 81 00:07:03,020 --> 00:07:12,200 female total 120 minus 14.4 will give 105.6. Or 0 82 00:07:12,200 --> 00:07:18,050 .88 times 120 will give the same value. Here, the 83 00:07:18,050 --> 00:07:21,730 expected is 21.6, so the compliment is the, I'm 84 00:07:21,730 --> 00:07:25,130 sorry, the expected is just the compliment, which 85 00:07:25,130 --> 00:07:32,010 is 180 minus 21.6 will give 158.4. Or 0.88 is the 86 00:07:32,010 --> 00:07:35,090 compliment of that one multiplied by 180 will give 87 00:07:35,090 --> 00:07:39,070 the same value. So that's the one we had discussed 88 00:07:39,070 --> 00:07:39,670 before. 89 00:07:42,410 --> 00:07:46,550 On this result, you can determine the value of chi 90 00:07:46,550 --> 00:07:50,750 -square statistic by using this equation. Sum of F 91 00:07:50,750 --> 00:07:53,810 observed minus F expected squared divided by F 92 00:07:53,810 --> 00:07:57,450 expected for each cell. You have to compute the 93 00:07:57,450 --> 00:08:00,870 value of chi-square for each cell. In this case, 94 00:08:01,070 --> 00:08:04,250 the simplest case is just 2 by 2 table. So 12 95 00:08:04,250 --> 00:08:09,980 minus 14.4 squared divided by 14.4. Plus the 96 00:08:09,980 --> 00:08:15,720 second one 108 minus 105 squared divided by 105 up 97 00:08:15,720 --> 00:08:19,780 to the last one, you will get this result. Now my 98 00:08:19,780 --> 00:08:21,900 chi-square value is 0.7576. 99 00:08:24,240 --> 00:08:28,140 And in this case, if chi-square value is very 100 00:08:28,140 --> 00:08:31,180 small, I mean it's close to zero, then we don't 101 00:08:31,180 --> 00:08:34,140 reject the null hypothesis. Because the smallest 102 00:08:34,140 --> 00:08:37,500 value of chi-square is zero, and zero happens only 103 00:08:37,500 --> 00:08:43,580 if f observed is close to f expected. So here if 104 00:08:43,580 --> 00:08:46,920 you look carefully for the observed and expected 105 00:08:46,920 --> 00:08:50,520 frequencies, you can tell if you can reject or 106 00:08:50,520 --> 00:08:53,700 don't reject the number. Now the difference 107 00:08:53,700 --> 00:08:58,960 between these values looks small, so that's lead 108 00:08:58,960 --> 00:09:05,110 to small chi-square. So without doing the critical 109 00:09:05,110 --> 00:09:08,210 value, computer critical value, you can determine 110 00:09:08,210 --> 00:09:11,890 that we don't reject the null hypothesis. Because 111 00:09:11,890 --> 00:09:16,070 your chi-square value is very small. So we don't 112 00:09:16,070 --> 00:09:18,670 reject the null hypothesis. Or if you look 113 00:09:18,670 --> 00:09:22,790 carefully at the table, for the table we have 114 00:09:22,790 --> 00:09:26,410 here, for chi-square table. By the way, the 115 00:09:26,410 --> 00:09:31,480 smallest value of chi-square is 1.3. under 1 116 00:09:31,480 --> 00:09:36,180 degrees of freedom. So the smallest value 1.32. So 117 00:09:36,180 --> 00:09:39,360 if your chi-square value is greater than 1, it 118 00:09:39,360 --> 00:09:41,920 means maybe you reject or don't reject. It depends 119 00:09:41,920 --> 00:09:45,920 on v value and alpha you have or degrees of 120 00:09:45,920 --> 00:09:50,280 freedom. But in the worst scenario, if your chi 121 00:09:50,280 --> 00:09:53,780 -square is smaller than this value, it means you 122 00:09:53,780 --> 00:09:57,600 don't reject the null hypothesis. So generally 123 00:09:57,600 --> 00:10:02,120 speaking, if Chi-square is statistical. It's 124 00:10:02,120 --> 00:10:06,420 smaller than 1.32. 1.32 is a very small value. 125 00:10:06,940 --> 00:10:15,560 Then we don't reject. Then we don't reject x0. 126 00:10:15,780 --> 00:10:24,220 That's always, always true. Regardless of degrees 127 00:10:24,220 --> 00:10:31,050 of freedom and alpha. My chi-square is close to 128 00:10:31,050 --> 00:10:35,710 zero, or smaller than 1.32, because the minimum 129 00:10:35,710 --> 00:10:40,990 value of critical value is 1.32. Imagine that we 130 00:10:40,990 --> 00:10:46,050 are talking about alpha is 5%. So alpha is 5, so 131 00:10:46,050 --> 00:10:48,750 your critical value, the smallest one for 1 132 00:10:48,750 --> 00:10:53,850 degrees of freedom, is 3.84. So that's my 133 00:10:53,850 --> 00:10:55,490 smallest, if alpha 134 00:11:03,740 --> 00:11:08,680 Last time we mentioned that this value is just 1 135 00:11:08,680 --> 00:11:17,760 .96 squared. And that's only true, only true for 2 136 00:11:17,760 --> 00:11:24,180 by 2 table. That means this square is just Chi 137 00:11:24,180 --> 00:11:29,470 square 1. For this reason, we can test by one 138 00:11:29,470 --> 00:11:33,330 equal by two, by two methods, either this 139 00:11:33,330 --> 00:11:37,750 statistic or chi-square statistic. Both of them 140 00:11:37,750 --> 00:11:41,970 will give the same result. So let's go back to the 141 00:11:41,970 --> 00:11:49,670 question we have. My chi-square value is 0.77576. 142 00:11:52,160 --> 00:11:56,940 So that's your chi-square statistic. Again, 143 00:11:57,500 --> 00:12:00,240 degrees of freedom 1 to chi-square, the critical 144 00:12:00,240 --> 00:12:08,500 value is 3.841. So my decision is we don't reject 145 00:12:08,500 --> 00:12:11,780 the null hypothesis. My conclusion is there is not 146 00:12:11,780 --> 00:12:14,380 sufficient evidence that two proportions are 147 00:12:14,380 --> 00:12:17,480 different. So you don't have sufficient evidence 148 00:12:17,480 --> 00:12:21,900 in order to support that the two proportions are 149 00:12:21,900 --> 00:12:27,720 different at 5% level of significance. We stopped 150 00:12:27,720 --> 00:12:32,700 last time at this point. Now suppose we are 151 00:12:32,700 --> 00:12:36,670 testing The difference among more than two 152 00:12:36,670 --> 00:12:42,930 proportions. The same steps, we have to extend in 153 00:12:42,930 --> 00:12:47,830 this case chi-square. Your null hypothesis, by one 154 00:12:47,830 --> 00:12:50,990 equal by two, all the way up to by C. So in this 155 00:12:50,990 --> 00:13:00,110 case, there are C columns. C columns and 156 00:13:00,110 --> 00:13:05,420 two rows. So number of columns equals C, and there 157 00:13:05,420 --> 00:13:10,520 are only two rows. So pi 1 equals pi 2, all the 158 00:13:10,520 --> 00:13:13,840 way up to pi C. So null hypothesis for the columns 159 00:13:13,840 --> 00:13:17,040 we have. There are C columns. Again, it's the 160 00:13:17,040 --> 00:13:19,840 alternative, not all of the pi J are equal, and J 161 00:13:19,840 --> 00:13:23,840 equals 1 up to C. Now, the only difference here, 162 00:13:26,520 --> 00:13:27,500 the degrees of freedom. 163 00:13:31,370 --> 00:13:32,850 For 2 by c table, 164 00:13:35,710 --> 00:13:42,010 2 by c, degrees of freedom equals number 165 00:13:42,010 --> 00:13:45,890 of rows minus 1. There are two rows, so 2 minus 1 166 00:13:45,890 --> 00:13:50,810 times number of columns minus 1. 2 minus 1 is 1, c 167 00:13:50,810 --> 00:13:54,610 minus 1, 1 times c minus 1, c minus 1. So your 168 00:13:54,610 --> 00:13:57,130 degrees of freedom in this case is c minus 1. 169 00:14:00,070 --> 00:14:03,190 So that's the only difference. For two by two 170 00:14:03,190 --> 00:14:07,130 table, degrees of freedom is just one. If there 171 00:14:07,130 --> 00:14:10,670 are C columns and we have the same number of rows, 172 00:14:11,450 --> 00:14:14,810 degrees of freedom is C minus one. And we have the 173 00:14:14,810 --> 00:14:19,190 same chi squared statistic, the same equation I 174 00:14:19,190 --> 00:14:23,890 mean. And we have to extend also the overall 175 00:14:23,890 --> 00:14:27,330 proportion instead of x1 plus x2 divided by n1 176 00:14:27,330 --> 00:14:32,610 plus n2. It becomes x1 plus x2 plus x3 all the way 177 00:14:32,610 --> 00:14:38,330 up to xc because there are c columns divided by n1 178 00:14:38,330 --> 00:14:41,910 plus n2 all the way up to nc. So that's x over n. 179 00:14:43,540 --> 00:14:48,400 So similarly we can reject the null hypothesis if 180 00:14:48,400 --> 00:14:52,260 the value of chi-square statistic lies or falls in 181 00:14:52,260 --> 00:14:54,160 the rejection region. 182 00:14:58,120 --> 00:15:01,980 Other type of chi-square test is called chi-square 183 00:15:01,980 --> 00:15:07,380 test of independence. Generally speaking, most of 184 00:15:07,380 --> 00:15:10,440 the time there are more than two columns or more 185 00:15:10,440 --> 00:15:16,490 than two rows. Now, suppose we have contingency 186 00:15:16,490 --> 00:15:22,370 table that has R rows and C columns. And we are 187 00:15:22,370 --> 00:15:26,990 interested to test to see whether the two 188 00:15:26,990 --> 00:15:31,390 categorical variables are independent. That means 189 00:15:31,390 --> 00:15:35,600 there is no relationship between them. Against the 190 00:15:35,600 --> 00:15:38,80 223 00:18:05,940 --> 00:18:11,560 tables with R rows and C columns. So we have the 224 00:18:11,560 --> 00:18:15,660 case R by C. So that's in general, there are R 225 00:18:15,660 --> 00:18:23,060 rows and C columns. And the question is this C, if 226 00:18:23,060 --> 00:18:27,480 the two variables are independent or not. So in 227 00:18:27,480 --> 00:18:30,700 this case, you cannot use this statistic. So one 228 00:18:30,700 --> 00:18:34,320 more time, this statistic is valid only for two by 229 00:18:34,320 --> 00:18:38,020 two tables. So that means we can use z or chi 230 00:18:38,020 --> 00:18:41,200 -square to test if there is no difference between 231 00:18:41,200 --> 00:18:43,960 two population proportions. But for more than 232 00:18:43,960 --> 00:18:46,700 that, you have to use chi-square. 233 00:18:49,950 --> 00:18:53,310 Now still we have the same equation, Chi-square 234 00:18:53,310 --> 00:18:57,870 statistic is just sum F observed minus F expected 235 00:18:57,870 --> 00:19:00,690 quantity squared divided by F expected. 236 00:19:03,490 --> 00:19:07,550 In this case, Chi-square statistic for R by C case 237 00:19:07,550 --> 00:19:15,430 has degrees of freedom R minus 1 multiplied by C 238 00:19:15,430 --> 00:19:18,570 minus 1. In this case, each cell in the 239 00:19:18,570 --> 00:19:21,230 contingency table has expected frequency at least 240 00:19:21,230 --> 00:19:26,910 one instead of five. Now let's see how can we 241 00:19:26,910 --> 00:19:31,690 compute the expected cell frequency for each cell. 242 00:19:32,950 --> 00:19:37,530 The expected frequency is given by row total 243 00:19:37,530 --> 00:19:42,950 multiplied by colon total divided by n. So that's 244 00:19:42,950 --> 00:19:50,700 my new equation to determine I've expected it. So 245 00:19:50,700 --> 00:19:56,440 the expected value for each cell is given by Rho 246 00:19:56,440 --> 00:20:03,380 total multiplied by Kono, total divided by N. 247 00:20:05,160 --> 00:20:09,540 Also, this equation is true for the previous 248 00:20:09,540 --> 00:20:15,560 example. If you go back a little bit here, now the 249 00:20:16,650 --> 00:20:21,650 Expected for this cell was 40.4. Now let's see how 250 00:20:21,650 --> 00:20:25,470 can we compute the same value by using this 251 00:20:25,470 --> 00:20:30,250 equation. So it's equal to row total 120 252 00:20:30,250 --> 00:20:40,310 multiplied by column total 36 divided by 300. 253 00:20:43,580 --> 00:20:46,500 Now before we compute this value by using B dash 254 00:20:46,500 --> 00:20:50,900 first, 300 divided by, I'm sorry, 36 divided by 255 00:20:50,900 --> 00:20:58,520 300. So that's your B dash. Then we multiply this 256 00:20:58,520 --> 00:21:03,540 B dash by N, and this is your N. So it's similar 257 00:21:03,540 --> 00:21:08,540 equation. So either you use row total multiplied 258 00:21:08,540 --> 00:21:14,060 by column total. then divide by overall sample 259 00:21:14,060 --> 00:21:18,880 size you will get the same result by using the 260 00:21:18,880 --> 00:21:25,520 overall proportion 12% times 120 so each one will 261 00:21:25,520 --> 00:21:29,860 give the same answer so from now we are going to 262 00:21:29,860 --> 00:21:33,900 use this equation in order to compute the expected 263 00:21:33,900 --> 00:21:37,960 frequency for each cell so again expected 264 00:21:37,960 --> 00:21:42,920 frequency is rho total times Column total divided 265 00:21:42,920 --> 00:21:48,620 by N, N is the sample size. So row total it means 266 00:21:48,620 --> 00:21:52,220 sum of all frequencies in the row. Similarly 267 00:21:52,220 --> 00:21:56,160 column total is the sum of all frequencies in the 268 00:21:56,160 --> 00:22:00,180 column and N is over all sample size. 269 00:22:03,030 --> 00:22:06,630 Again, we reject the null hypothesis if your chi 270 00:22:06,630 --> 00:22:10,430 -square statistic greater than chi-square alpha. 271 00:22:10,590 --> 00:22:13,370 Otherwise, you don't reject it. And keep in mind, 272 00:22:14,270 --> 00:22:18,390 chi-square statistic has degrees of freedom R 273 00:22:18,390 --> 00:22:23,730 minus 1 times C minus 1. That's all for chi-square 274 00:22:23,730 --> 00:22:27,590 as test of independence. Any question? 275 00:22:31,220 --> 00:22:36,300 Here there is an example for applying chi-square 276 00:22:36,300 --> 00:22:42,200 test of independence. Meal plan selected 277 00:22:42,200 --> 00:22:46,700 by 200 students is shown in this table. So there 278 00:22:46,700 --> 00:22:50,960 are two variables of interest. The first one is 279 00:22:50,960 --> 00:22:56,230 number of meals per week. And there are three 280 00:22:56,230 --> 00:23:00,550 types of number of meals, either 20 meals per 281 00:23:00,550 --> 00:23:07,870 week, or 10 meals per week, or none. So that's, so 282 00:23:07,870 --> 00:23:12,150 number of meals is classified into three groups. 283 00:23:13,210 --> 00:23:17,650 So three columns, 20 per week, 10 per week, or 284 00:23:17,650 --> 00:23:23,270 none. Class standing, students are classified into 285 00:23:23,270 --> 00:23:28,860 four levels. A freshman, it means students like 286 00:23:28,860 --> 00:23:33,620 you, first year. Sophomore, it means second year. 287 00:23:34,440 --> 00:23:38,400 Junior, third level. Senior, fourth level. So that 288 00:23:38,400 --> 00:23:42,100 means first, second, third, and fourth level. And 289 00:23:42,100 --> 00:23:46,140 we have this number, these numbers for, I mean, 290 00:23:47,040 --> 00:23:53,660 there are 24 A freshman who have meals for 20 per 291 00:23:53,660 --> 00:23:59,880 week. So there are 24 freshmen have 20 meals per 292 00:23:59,880 --> 00:24:04,160 week. 22 sophomores, the same, 10 for junior and 293 00:24:04,160 --> 00:24:10,220 14 for senior. And the question is just to see if 294 00:24:10,220 --> 00:24:13,740 number of meals per week is independent of class 295 00:24:13,740 --> 00:24:17,270 standing. to see if there is a relationship 296 00:24:17,270 --> 00:24:21,890 between these two variables. In this case, there 297 00:24:21,890 --> 00:24:26,850 are four rows because the class standing is 298 00:24:26,850 --> 00:24:29,190 classified into four groups. So there are four 299 00:24:29,190 --> 00:24:34,230 rows and three columns. So this table actually is 300 00:24:34,230 --> 00:24:40,200 four by three. And there are twelve cells in this 301 00:24:40,200 --> 00:24:46,660 case. Now it takes time to compute the expected 302 00:24:46,660 --> 00:24:49,760 frequencies because in this case we have to 303 00:24:49,760 --> 00:24:55,120 compute the expected frequency for each cell. And 304 00:24:55,120 --> 00:25:01,320 we are going to use this formula for only six of 305 00:25:01,320 --> 00:25:06,260 them. I mean, we can apply this formula for only 306 00:25:06,260 --> 00:25:09,880 six of them. And the others can be computed by the 307 00:25:09,880 --> 00:25:14,300 complement by using either column total or row 308 00:25:14,300 --> 00:25:19,940 total. So because degrees of freedom is six, that 309 00:25:19,940 --> 00:25:23,880 means you may use this rule six times only. The 310 00:25:23,880 --> 00:25:28,420 others can be computed by using the complement. So 311 00:25:28,420 --> 00:25:34,070 here again, the hypothesis to be tested is, Mean 312 00:25:34,070 --> 00:25:36,550 plan and class standing are independent, that 313 00:25:36,550 --> 00:25:38,670 means there is no relationship between them. 314 00:25:39,150 --> 00:25:41,650 Against alternative hypothesis, mean plan and 315 00:25:41,650 --> 00:25:44,630 class standing are dependent, that means there 316 00:25:44,630 --> 00:25:49,950 exists significant relationship between them. Now 317 00:25:49,950 --> 00:25:54,390 let's see how can we compute the expected cell, 318 00:25:55,990 --> 00:26:00,470 the expected frequency for each cell. For example, 319 00:26:02,250 --> 00:26:07,790 The first observed frequency is 24. Now the 320 00:26:07,790 --> 00:26:15,990 expected should be 70 times 70 divided by 200. So 321 00:26:15,990 --> 00:26:25,050 for cell 11, the first cell. If expected, we can 322 00:26:25,050 --> 00:26:32,450 use this notation, 11. Means first row. First 323 00:26:32,450 --> 00:26:40,110 column. That should be 70. It is 70. Multiplied by 324 00:26:40,110 --> 00:26:43,990 column totals. Again, in this case, 70. Multiplied 325 00:26:43,990 --> 00:26:47,270 by 200. That will give 24.5. 326 00:26:50,150 --> 00:26:53,730 Similarly, for the second cell, for 32. 327 00:26:56,350 --> 00:27:00,090 70 times 88 divided by 200. 328 00:27:02,820 --> 00:27:12,620 So for F22, again it's 70 times 88 divided by 200, 329 00:27:12,800 --> 00:27:22,060 that will get 30.8. So 70 times 88, that will give 330 00:27:22,060 --> 00:27:32,780 30.8. F21, rule two first, one third. rho 1 second 331 00:27:32,780 --> 00:27:37,600 one the third one now either you can use the same 332 00:27:37,600 --> 00:27:44,320 equation which is 70 times 42 so you can use 70 333 00:27:44,320 --> 00:27:54,360 times 42 divided by 200 that will give 14.7 or 334 00:27:54,360 --> 00:27:59,000 it's just the complement which is 70 minus 335 00:28:03,390 --> 00:28:14,510 24.5 plus 30.8. So either use 70 multiplied by 40 336 00:28:14,510 --> 00:28:19,390 divided by 200 or just the complement, 70 minus. 337 00:28:20,800 --> 00:28:28,400 24.5 plus 30.8 will give the same value. So I just 338 00:28:28,400 --> 00:28:32,740 compute the expected cell for 1 and 2, and the 339 00:28:32,740 --> 00:28:36,120 third one is just the complement. Similarly, for 340 00:28:36,120 --> 00:28:42,560 the second row, I mean cell 21, then 22, and 23. 341 00:28:43,680 --> 00:28:47,940 By using the same method, he will get these two 342 00:28:47,940 --> 00:28:51,880 values, and the other one is the complement, which 343 00:28:51,880 --> 00:28:54,880 is 60 minus these, the sum of these two values, 344 00:28:55,300 --> 00:28:55,960 will give 12. 345 00:28:58,720 --> 00:29:01,920 Similarly, for the third cell, I'm sorry, the 346 00:29:01,920 --> 00:29:07,460 third row, for this value, For 10, it's 30 times 347 00:29:07,460 --> 00:29:12,660 70 divided by 200 will give this result. And the 348 00:29:12,660 --> 00:29:16,060 other one is just 30 multiplied by 88 divided by 349 00:29:16,060 --> 00:29:20,200 200. The other one is just the complement, 30 350 00:29:20,200 --> 00:29:25,180 minus the sum of these. Now, for the last column, 351 00:29:26,660 --> 00:29:35,220 either 70 multiplied by 70 divided by 200, or 70 352 00:29:35,220 --> 00:29:41,780 this 70 minus the sum of these. 70 this one equals 353 00:29:41,780 --> 00:29:51,740 70 minus the sum of 24 plus 21 plus 10. That will 354 00:29:51,740 --> 00:30:01,120 give 14. Now for the other expected cell, 88. 355 00:30:02,370 --> 00:30:05,530 minus the sum of these three expected frequencies. 356 00:30:07,290 --> 00:30:12,810 Now for the last one, last one is either by 42 357 00:30:12,810 --> 00:30:17,770 minus the sum of these three, or 40 minus the sum 358 00:30:17,770 --> 00:30:20,090 of 14 plus 6, 17.6. 359 00:30:22,810 --> 00:30:27,940 Or 40 multiplied by 42 divided by 400. So let's 360 00:30:27,940 --> 00:30:35,180 say we use that formula six times. For this 361 00:30:35,180 --> 00:30:39,100 reason, degrees of freedom is six. The other six 362 00:30:39,100 --> 00:30:46,480 are computed by the complement as we mentioned. So 363 00:30:46,480 --> 00:30:50,240 these are the expected frequencies. It takes time 364 00:30:50,240 --> 00:30:56,010 to compute these. But if you have only two by two 365 00:30:56,010 --> 00:31:01,170 table, it's easier. Now based on that, we can 366 00:31:01,170 --> 00:31:07,430 compute chi-square statistic value by using this 367 00:31:07,430 --> 00:31:12,390 equation for each cell. I mean, the first one, if 368 00:31:12,390 --> 00:31:14,370 you go back a little bit to the previous table, 369 00:31:15,150 --> 00:31:18,130 here, in order to compute chi-square, 370 00:31:22,640 --> 00:31:27,760 value, we have to use this equation, pi squared, 371 00:31:28,860 --> 00:31:36,080 sum F observed minus F expected squared, divided 372 00:31:36,080 --> 00:31:41,980 by F expected for all C's. So the first one is 24 373 00:31:41,980 --> 00:31:44,780 minus squared, 374 00:31:46,560 --> 00:31:55,350 24 plus. The second cell is 32 squared 375 00:31:55,350 --> 00:31:58,990 plus 376 00:31:58,990 --> 00:32:02,930 all the way up to the last cell, which is 10. 377 00:32:11,090 --> 00:32:14,430 So it takes time. But again, for two by two, it's 378 00:32:14,430 --> 00:32:18,890 straightforward. Anyway, now if you compare the 379 00:32:18,890 --> 00:32:23,650 expected and observed cells, you can have an idea 380 00:32:23,650 --> 00:32:25,650 either to reject or fail to reject without 381 00:32:25,650 --> 00:32:31,470 computing the value itself. Now, 24, 24.5. The 382 00:32:31,470 --> 00:32:32,430 difference is small. 383 00:32:35,730 --> 00:32:39,070 for about 7 and so on. So the difference between 384 00:32:39,070 --> 00:32:44,450 observed and expected looks small. In this case, 385 00:32:44,590 --> 00:32:50,530 chi-square value is close to zero. So it's 709. 386 00:32:51,190 --> 00:32:55,370 Now, without looking at the table we have, we have 387 00:32:55,370 --> 00:33:02,710 to don't reject. So we don't reject Because as we 388 00:33:02,710 --> 00:33:05,450 mentioned, the minimum k squared value is 1132. 389 00:33:06,350 --> 00:33:09,670 That's for one degrees of freedom and the alpha is 390 00:33:09,670 --> 00:33:14,390 25%. So 391 00:33:14,390 --> 00:33:19,250 I expect my decision is don't reject the null 392 00:33:19,250 --> 00:33:24,530 hypothesis. Now by looking at k squared 5% and 393 00:33:24,530 --> 00:33:28,870 degrees of freedom 6 by using k squared theorem. 394 00:33:30,200 --> 00:33:36,260 Now degrees of freedom 6. Now the minimum value of 395 00:33:36,260 --> 00:33:40,520 Chi-square is 7.84. I mean critical value. But 396 00:33:40,520 --> 00:33:48,290 under 5% is 12.59. So this value is 12.59. So 397 00:33:48,290 --> 00:33:54,470 critical value is 12.59. So my rejection region is 398 00:33:54,470 --> 00:33:59,890 above this value. Now, my chi-square value falls 399 00:33:59,890 --> 00:34:06,250 in the non-rejection regions. It's very small 400 00:34:06,250 --> 00:34:13,850 value. So chi-square statistic is 0.709. 401 00:34:14,230 --> 00:34:20,620 It's much smaller. Not even smaller than π²α, it's 402 00:34:20,620 --> 00:34:23,580 much smaller than this value, so it means we don't 403 00:34:23,580 --> 00:34:26,440 have sufficient evidence to support the 404 00:34:26,440 --> 00:34:32,010 alternative hypothesis. So my decision is, don't 405 00:34:32,010 --> 00:34:36,350 reject the null hypothesis. So conclusion, there 406 00:34:36,350 445 00:38:19,540 --> 00:38:25,080 Z statistic or Chi-squared. So Z or Chi can be 446 00:38:25,080 --> 00:38:28,920 used for testing difference between two population 447 00:38:28,920 --> 00:38:34,360 proportions. And again, chi-square can be extended 448 00:38:34,360 --> 00:38:40,140 to use for more than two. So in this case, the 449 00:38:40,140 --> 00:38:43,220 correct answer is C, because we can use either Z 450 00:38:43,220 --> 00:38:52,090 or chi-square test. Next, in testing hypothesis 451 00:38:52,090 --> 00:38:58,350 using chi-square test. The theoretical frequencies 452 00:38:58,350 --> 00:39:03,190 are based on the null hypothesis, alternative, normal 453 00:39:03,190 --> 00:39:06,490 distribution, none of the above. Always when we 454 00:39:06,490 --> 00:39:10,450 are using chi-square test, we assume the null is 455 00:39:10,450 --> 00:39:14,630 true. So the theoretical frequencies are based on 456 00:39:14,630 --> 00:39:20,060 the null hypothesis. So always any statistic can 457 00:39:20,060 --> 00:39:25,300 be computed if we assume x0 is correct. So the 458 00:39:25,300 --> 00:39:26,400 correct answer is A. 459 00:39:34,060 --> 00:39:37,040 Let's look at table 11-2. 460 00:39:44,280 --> 00:39:49,000 Many companies use well-known celebrities as 461 00:39:49,000 --> 00:39:54,420 spokespersons in their TV advertisements. A study 462 00:39:54,420 --> 00:39:57,760 was conducted to determine whether brand awareness 463 00:39:57,760 --> 00:40:02,140 of female TV viewers and the gender of the 464 00:40:02,140 --> 00:40:05,860 spokesperson are independent. So there are two 465 00:40:05,860 --> 00:40:09,820 variables, whether a brand awareness of female TV 466 00:40:09,820 --> 00:40:13,740 and gender of the spokesperson are independent. 467 00:40:14,820 --> 00:40:19,540 Each and a sample of 300 female TV viewers was 468 00:40:19,540 --> 00:40:24,000 asked to identify a product advertised by a 469 00:40:24,000 --> 00:40:27,000 celebrity spokesperson, the gender of the 470 00:40:27,000 --> 00:40:32,280 spokesperson, and whether or not the viewer could 471 00:40:32,280 --> 00:40:36,460 identify the product was recorded. The number in 472 00:40:36,460 --> 00:40:40,080 each category are given below. Now, the questions 473 00:40:40,080 --> 00:40:45,520 are, number one, he asked about the calculated 474 00:40:45,520 --> 00:40:49,120 this statistic is. We have to find Chi-square 475 00:40:49,120 --> 00:40:54,020 statistic. It's two by two tables, easy one. So, 476 00:40:54,460 --> 00:40:59,460 for example, to find the F expected is, 477 00:41:00,420 --> 00:41:13,130 rho total is one over two. And one line here. And 478 00:41:13,130 --> 00:41:13,810 this 150. 479 00:41:16,430 --> 00:41:22,510 And also 150. So the expected frequency for the 480 00:41:22,510 --> 00:41:31,010 first one is 102 times 150 divided by 300. 481 00:41:35,680 --> 00:41:39,640 So the answer is 51. 482 00:41:42,880 --> 00:41:51,560 So the first expected is 51. The other one is just 483 00:41:51,560 --> 00:41:54,360 102 minus 51 is also 51. 484 00:41:57,320 --> 00:42:01,020 Now here is 99. 485 00:42:09,080 --> 00:42:15,180 So the second 486 00:42:15,180 --> 00:42:18,800 one are the expected frequencies. So my chi-square 487 00:42:18,800 --> 00:42:22,400 statistic is 488 00:42:22,400 --> 00:42:32,260 41 minus 51 squared divided by 51 plus 61 minus 51 489 00:42:32,260 --> 00:42:44,160 squared. 561 plus 109 minus 99 squared 99 plus 89 490 00:42:44,160 --> 00:42:47,040 minus 99 squared. 491 00:42:49,080 --> 00:42:53,140 That will give 5 point. 492 00:42:57,260 --> 00:43:01,760 So the answer is 5.9418. 493 00:43:03,410 --> 00:43:06,210 So simple calculation will give this result. Now, 494 00:43:06,450 --> 00:43:10,370 next one, referring to the same information we 495 00:43:10,370 --> 00:43:15,890 have at 5% level of significance, the critical 496 00:43:15,890 --> 00:43:18,510 value of that statistic. In this case, we are 497 00:43:18,510 --> 00:43:22,690 talking about 2 by 2 table, and alpha is 5. So 498 00:43:22,690 --> 00:43:28,130 your critical value is 3 point. So chi squared 499 00:43:28,130 --> 00:43:31,610 alpha, 5% and 1 degrees of freedom. 500 00:43:35,000 --> 00:43:39,220 This is the smallest value when alpha is 5%, so 3 501 00:43:39,220 --> 00:43:41,440 .8415. 502 00:43:46,160 --> 00:43:51,760 Again, degrees of freedom of this statistic are 1, 503 00:43:52,500 --> 00:43:53,800 2 by 2 is 1. 504 00:43:56,380 --> 00:44:01,620 Now at 5% level of significance, the conclusion is 505 00:44:01,620 --> 00:44:01,980 that 506 00:44:06,840 --> 00:44:16,380 In this case, we reject H0. And H0 says the two 507 00:44:16,380 --> 00:44:20,800 variables are independent. X and Y are 508 00:44:20,800 --> 00:44:25,860 independent. We reject that they are independent. 509 00:44:27,380 --> 00:44:33,200 That means they are dependent or related. So, A, 510 00:44:33,520 --> 00:44:36,680 brand awareness of female TV viewers and the 511 00:44:36,680 --> 00:44:41,380 gender of the spokesperson are independent. No, 512 00:44:41,580 --> 00:44:45,200 because we reject the null hypothesis. B, brand 513 00:44:45,200 --> 00:44:48,340 awareness of female TV viewers and the gender of 514 00:44:48,340 --> 00:44:53,140 spokesperson are not independent. Since we reject, 515 00:44:53,380 --> 00:44:58,330 then they are not. Because it's a complement. So, 516 00:44:58,430 --> 00:45:02,810 B is the correct answer. Now, C. A brand awareness 517 00:45:02,810 --> 00:45:05,450 of female TV viewers and the gender of the 518 00:45:05,450 --> 00:45:10,550 spokesperson are related. The same meaning. They 519 00:45:10,550 --> 00:45:15,470 are either, you say, not independent, related or 520 00:45:15,470 --> 00:45:15,950 dependent. 521 00:45:19,490 --> 00:45:24,930 Either is the same, so C is correct. D both B and 522 00:45:24,930 --> 00:45:28,970 C, so D is the correct answer. So again, if we 523 00:45:28,970 --> 00:45:31,650 reject the null hypothesis, it means the two 524 00:45:31,650 --> 00:45:36,990 variables either not independent or related or 525 00:45:36,990 --> 00:45:38,290 dependent. 526 00:45:40,550 --> 00:45:46,630 Any question? I will stop at this point. Next 527 00:45:46,630 --> 00:45:47,750 time, inshallah, we'll start.