Dangerous Time to Drive? Are some times worse than others?
Many studies have been done on this theme. This particular study simply divides
the 24-hour day into four equal parts:
| 6:00am to 12:00(noon) |
| 12:00(noon) to 6:00pm |
| 6:00pm to 12:00(mid) |
| 12:00(mid) to 6:00am |
| Category | Actual frequency |
|
|
|
| 6:00am to 12:00(noon) | 128 |
| 12:00(noon) to 6:00pm | 115 |
| 6:00pm to 12:00(mid) | 160 |
| 12:00(mid) to 6:00am | 224 |
Foundations and definitions
The observed frequency, O , of a category is the frequency for the category observed in the sample data. (Observed frequency can also be considered as actual data frequency.)
The expected frequency, E , of a category is the calculated frequency for this category.
Critical chi-squared value (Boundary of critical region) is to be found in
the Chi-squared Table.
Test statistic in this chapter is chi-squared (X2)
where
.
In a typical question all observed values(O) must be given and the ability
to calculate the expected values(E) must be present. In general Ei
= npi where Ei is the expected value of category i and pi
is the probability of category i implied in the question.
| Category | Actual frequency | Expected Frequency | Chi-square |
|
|
|||
| 6:00am to 12:00(noon) | 128 | ||
| 12:00(noon) to 6:00pm | 115 | ||
| 6:00pm to 12:00(mid) | 160 | ||
| 12:00(mid) to 6:00am | 224 | ||
Expected frequencies are calculated by Ei = npi . In
this question I=1,2,3,4 for the four categories. Probabilities are all the same
0.25 and 0.25 and 0.25 and 0.25.
(This question only)
The number n is the total car deaths so that n = 627
E1 = 627(0.25) =156.75 E2 = 627(0.25) =156.75
E3 = 627(0.25) =156.75 E4 = 627(0.25) =156.75
(Because of equal probabilities)
| Category | Actual frequency (O) | Expected Frequency(E) | Chi-square |
|
|
|||
| 6:00am to 12:00(noon) | 128 | 156.75 | |
| 12:00(noon) to 6:00pm | 115 | 156.75 | |
| 6:00pm to 12:00(mid) | 160 | 156.75 | |
| 12:00(mid) to 6:00am | 224 | 156.75 | |
Last column is calculated by (Observed - Expected)2
/ Expected or (O - E )2 / E
| Category | Actual frequency (O) | Expected Frequency(E) | Chi-square |
|
|
|||
| 6:00am to 12:00(noon) | 128 | 156.75 | 5.273 |
| 12:00(noon) to 6:00pm | 115 | 156.75 | 11.120 |
| 6:00pm to 12:00(mid) | 160 | 156.75 | 00.067 |
| 12:00(mid) to 6:00am | 224 | 156.75 | 28.852 |
| 45.312 | |||
Our test statistic chi-squared X2 is : X2= 45.312
Is it in the critical region?
We must check the chi-squared table.
The 95% critical value for chi-squared(Right tail only) is c2 = 7.815 found so that we are using (n-1) degrees of freedom which is (4-1)=3 degrees in this question.
Conclusions: 
Our test statistic is indeed much larger than the critical chi-squared value.
Our test statistic is in the critical region. We reject the null hypothesis.
We reject the claim that car deaths are distributed as 25% / 25% / 25% /25%
among 4 time categories.
| Category | Expected (Percentage) | Observed(O) | Expected(E) | chi-squared |
|
|
||||
| Classical | 10% | 41 | ||
| Country | 32% | 219 | ||
| Oldies | 4% | 53 | ||
| Lite Rock | 12% | 91 | ||
| Pop | 15% | 60 | ||
| Heavy Rock | 27% | 236 | ||
Expected frequencies(E) are found by multiplying the n=700 by the probability
for the category. E1 = (700)*(0.10) = 70 E2 = (700)*(0.32)
= 224 and so on.
We
get:
Giving us a test statistic of chi-squared equal to 65.99. Critical chi-squared is found in the table as X2= 15.086 Our test statistic of 65.99 is well into the critical region. We reject null
hypothesis. We reject the senior manager's percentages of presumed musical preferences.
Category
Expected (Percentage)
Observed(O)
Expected(E)
chi-squared
Classical
10%
41
70
12.01
Country
32%
219
224
00.11
Oldies
4%
53
28
22.32
Lite Rock
12%
91
84
00.58
Pop
15%
60
105
19.28
Heavy Rock
27%
236
189
11.69
Totals
700
700
65.99
![]() |
|
||||||||||||||||
Actual last 700 sales included classical (41) country (219) Oldies (53) Lite
Rock (91)
Pop (60) and Heavy Rock (236).
An rXc contingency table shows the observed frequencies for two variables. The obverved frequencies (O) are arranged in r rows and c columns.
Below we will use r=3 and c=4 for 3X4 contingency table.( It is a 3X4 matrix or a 3X4 array.)
Medical trial (299 volunteers)
| | Treatment Result | |||
| | Excellent | Good | Fair | No Difference |
| Treatment A | 10 | 29 | 30 | 34 |
| Treatment B | 9 | 28 | 35 | 26 |
| Treatment C | 7 | 19 | 28 | 43 |
The
claim is that the proportions in the different treatment results should be equal.
The claim is identified with the null hypothesis.
Use same test statistic chi-squared is X2= But E , the expected frequencies must be calculated a little differently.
In brackets beside the O values place in the E values starting with In this question X2 = 7.901 . (Test statistic) The answer is that we must check the chi-squared Table and look up the critical
value of chi-squared. For once, our test statistic is NOT in the
critical region. Fail to reject the null hypothesis. Fail to reject the equality of the 3 treatment results. (Mild acceptance that there is not much difference with 3 treatment results.)
(O-E)2
/ E .
E= (Row sum)X(Column Sum) / Total There will be 3 X 4 = 12 expected frequencies(E)
Treatment Result (Observed)
Excellent
Good
Fair
No Difference
Totals
Treatment A
10
29
30
34
103
Treatment B
9
28
35
26
98
Treatment C
7
19
28
43
97
Totals
26
76
93
103
298
E = (26X103)/298 = 8.99
And
then E = (76X103)/298 =26.3 as we move across the first row :
(O-E)2 / E calculations and then you add the twelve to get the test
statistic
X2= S (O-E)2 / E
Treatment Result (Observed)
Excellent
Good
Fair
No Difference
Totals
Treatment A
10 (8.99)
29 (26.3)
30 (32.1)
34 (35.6)
103
Treatment B
9 (8.6)
28 (26.0)
35 (30.6)
26 (33.9)
98
Treatment C
7 (8.5)
19 (24.7)
28 (30.3)
43 (33.5)
97
Totals
26
76
93
103
298
99%confidence level.
Use Right Hand Tail at 01%. Use (r-1)X(c-1) degrees of freedom. There are
r=3 rows and c=4 columns so that we get (3-1)X(4-1) = 6 degrees of freedom.
Critical X2= 16.812
(Grades
are A, B , C , D , F )| | Grades Awarded | ||||
| | A | B | C | D | F |
| Military | 25 | 46 | 19 | 5 | 3 |
| Government | 18 | 44 | 24 | 7 | 5 |
| Media/Press | 5 | 23 | 37 | 21 | 12 |
| First get the row totals and the column totals: | Perform the E value calculations. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Add up the fifteen (O-E)2 / E calculations to get the test statistic
In this question X2= 46.78 (test statistic)
Reject the null hypothesis.
Reject the hypothesis of equal proportions or percentages for the 3 institutions.