In: Statistics and Probability
3. Chi-Squared test of Independence.
Use the sample data below to test whether car color affects the likelihood of being in an accident at 0.05 level of significance.

H0: Null Hypothesis: Car color does not affect the likelihood of being in an accident
HA: Alternative Hypothesis: Car color affects the likelihood of being in an accident
Assuming H0 the Expected Frequencies are got asfollows:
| Red | Blue | Green | Total | |
| Car has been in an accident | 51X97/172=28.76 | 31.02 | 37.22 | 97 | 
| Car has not been in an accident | 22.24 | 23.98 | 28.78 | 75 | 
| Total | 51 | 55 | 66 | 172 | 
Chi Square Table is formed as follows:
| O | E | (O - E)2/E | 
| 28 | 28.76 | 0.02 | 
| 33 | 31.02 | 0.13 | 
| 36 | 37.22 | 0.04 | 
| 23 | 22.24 | 0.03 | 
| 22 | 23.98 | 0.16 | 
| 30 | 28.78 | 0.05 | 
Total =  
 = | 
0.43 | 
ndf = (c - 1) X (r - 1)
=(3 - 1) X (2 - 1) = 2
By Technology, P - Value = 0.8071
Since P - Value = 0.8071 is greater than 
 = 0.05, thedifference is not significant. Fail to reject null
hypothesis.
Conclusion:
The data do not support the claim that car color affects the likelihood of being in an accident