In: Math
An electronics store has 4 branches in a large city. They are curious if sales in any particular department are different depending on location. They take a random sample of purchases throughout the 4 branches – the results are recorded below. Run an independence test for the data below at the 0.05 level of significance.
Appliances |
TV |
Computers |
Cameras |
Cell Phones |
|
Branch 1 |
54 |
28 |
61 |
24 |
81 |
Branch 2 |
44 |
21 |
55 |
23 |
92 |
Branch 3 |
49 |
18 |
49 |
30 |
72 |
Branch 4 |
51 |
29 |
65 |
29 |
102 |
What is the Test statistic (?2) and how is it done in excel?
The hypothesis being tested is:
H0: Sales and location are independent
Ha: Sales and location are not independent
The output is:
Col 1 | Col 2 | Col 3 | Col 4 | Col 5 | Total | ||
Row 1 | Observed | 54 | 28 | 61 | 24 | 81 | 248 |
Expected | 50.26 | 24.37 | 58.38 | 26.91 | 88.08 | 248.00 | |
O - E | 3.74 | 3.63 | 2.62 | -2.91 | -7.08 | 0.00 | |
(O - E)² / E | 0.28 | 0.54 | 0.12 | 0.31 | 0.57 | 1.82 | |
Row 2 | Observed | 44 | 21 | 55 | 23 | 92 | 235 |
Expected | 47.63 | 23.09 | 55.32 | 25.50 | 83.46 | 235.00 | |
O - E | -3.63 | -2.09 | -0.32 | -2.50 | 8.54 | 0.00 | |
(O - E)² / E | 0.28 | 0.19 | 0.00 | 0.24 | 0.87 | 1.58 | |
Row 3 | Observed | 49 | 18 | 49 | 30 | 72 | 218 |
Expected | 44.18 | 21.42 | 51.32 | 23.65 | 77.43 | 218.00 | |
O - E | 4.82 | -3.42 | -2.32 | 6.35 | -5.43 | 0.00 | |
(O - E)² / E | 0.53 | 0.55 | 0.10 | 1.70 | 0.38 | 3.26 | |
Row 4 | Observed | 51 | 29 | 65 | 29 | 102 | 276 |
Expected | 55.93 | 27.12 | 64.97 | 29.94 | 98.03 | 276.00 | |
O - E | -4.93 | 1.88 | 0.03 | -0.94 | 3.97 | 0.00 | |
(O - E)² / E | 0.44 | 0.13 | 0.00 | 0.03 | 0.16 | 0.76 | |
Total | Observed | 198 | 96 | 230 | 106 | 347 | 977 |
Expected | 198.00 | 96.00 | 230.00 | 106.00 | 347.00 | 977.00 | |
O - E | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | |
(O - E)² / E | 1.52 | 1.41 | 0.22 | 2.29 | 1.98 | 7.42 | |
7.42 | chi-square | ||||||
12 | df | ||||||
.8285 | p-value |
Expected Value = (Row Total*Column Total)/Marginal Total
For example, for 54,
Expected Value = (248*198)/977 = 50.26
For example, for 28,
Expected Value = (248*96)/977 = 24.37
Similarly, for all.
Find Observed - Expected(O - E) and (O - E)² / E.
Sum up from both sides to get the chi-square test statistic which is 7.42.
df = (row - 1)*(column - 1) = (4 - 1)* (5-1) = 12
p-value from the table is 0.8285.
Since the p-value (0.8285) is greater than the significance level (0.05), we cannot reject the null hypothesis.
Therefore, we can conclude that sales in any particular department are different depending on location.