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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828

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.