00:02
So today we're looking at whether or not gender and feelings about accident rates are independent.
00:07
So there was 564 people that were sampled and they were asked what they think will happen to accidents and specifically the rate of accidents with driverless cars.
00:16
So this is the counts of the females and males who said it would decrease, stay the same, or increase.
00:21
So for example there were 208 males who said it would decrease while 136 females said it would decrease and 40 males said stay the same versus 69 stay the same and here are the counts for the increase.
00:32
And what i've done is i've tallied up the rows and columns to get the total number of females, total males, total people who thought would decrease, stay the same, and increase.
00:40
And so we're going to test this set of hypotheses that the null is that gender and feelings about accident rates are independent versus the alternative where the gender and feelings about accident rates are dependent.
00:56
So we're going to test this at the alpha of 0 .01 level of significance.
01:02
What that means is we're going to get a p -value from our chi -squared statistic and if the p -value is less than the alpha we're going to reject our null hypothesis.
01:10
And so this is a chi -squared test for independence.
01:14
Test for independence and that chi -squared value will get us our p -value.
01:28
So to calculate the chi -squared statistic this is what we observed we need to figure out what we'd expect.
01:32
So the expected values are equal to the total in the row times the total in the column divided by the total in the sample.
01:40
And that's why t sub t the total total.
01:43
So that's what these are.
01:45
Here we have the expected counts here.
01:48
So for example there we observed 136 females who thought would decrease.
01:54
We'd expect 176 .269 and i got that value by taking the total in the row total females 289 times the total in the column total decrease and divide that by 564 the total in the sample.
02:08
We do that same multiplication or the same operation for each of the six cells.
02:15
Here's what we would expect.
02:17
So as we're looking at it we can see that all right well first of the 136 versus 176 that's quite a bit of a difference.
02:25
And if we're looking at here we go male increase we observed 27 but we'd expect 54.
02:31
Those are different right.
02:32
We'll see if those differences are significant and that's what the whole chi -squared statistic is going to tell us.
02:38
And something to note in order for the chi -squared statistic to be or this chi -squared test to to be valid the number of the expected values in each cell need to be greater than five.
02:54
And indeed they are.
02:55
So we're good to go.
02:57
So we state our hypotheses.
02:59
Let's go and get our chi -squared statistic which is equal to the sum of the observed values minus the expected values squared.
03:09
Whatever the expected values.
03:11
So for example it's a it's it's kind of a tedious calculation in terms of writing them all out but it's important to see how it works.
03:19
I'll show you.
03:20
So the observed female decrease is 136 minus the expected female decrease is 176 .3 squared divided by 176 .3.
03:32
And we do that for each cell...