00:01
Okay, so in each of these cases, we're going to be doing a chi -square test for independence, where we're going to have our table of observed values, which we've been given, and then we're going to calculate our table of expected values, which are going to be given by the row total of the box in question, times the column total, divided by the overall total.
00:24
And then we're going to calculate our chi -square statistic as the sum over each box in the table of the observed value minus the expected value squared over the expected value and then we're going to find a p -value from that to see if they're independent.
00:40
The null hypothesis is going to be that they are independent and the alternative hypothesis is going to be that they are dependent.
00:49
And so let's go for part i.
00:58
Now here we're just looking at the first two rows and so i've just copied them out into a table here.
01:03
So this is our table of observed values for drugs and no drugs and for schizophrenia and affective disorder.
01:13
And so those are the observed values.
01:16
Then i calculated the expected values doing what i said above.
01:19
So for example, this box here is given by the row total of its corresponding observed value times the column total divided by the overall total and so on and so on.
01:30
And then if you calculate the chi -square test statistic for this, you get 0 .892 to three decimal places.
01:38
Degrees of freedom here is the number of rows minus one times the number of columns minus one.
01:42
There are two rows and two columns, so it's two minus one times two minus one, which is just one.
01:46
And the p -value for that chi -square value with one degree of freedom is 0 .345.
01:53
And so we would say there's no evidence to suggest that they are dependent, dependent or to suggest a relationship.
02:10
For ii we're then doing the third and fourth rows and again i've just written down the same thing here so the observed values are given here from that we compute the expected values which i've popped here and then using the formula i i put at the top, we do the chi -square value, which here is 0 .0145...