Instructor: Hello students.
Welcome to Biostats ER, example six, chapter seven.
In this example we will learn how to perform
hypothesis testing for categorical outcome
when we have two or more samples.
We are going to use problem 29
from our textbook for this example.
And first, I will read the problem.
"Some scientists believe that alcoholism is linked
to social isolation.
One measure of social isolation is marital status.
A study of 280 adults is conducted
and each participant is classified as not alcoholic,
diagnosed alcoholic, and undiagnosed alcoholic,
and categorized by marital status.
Is there significant evidence of an association?
Run the appropriate test at a 5% level of significance."
So, here we have inserted the independent variable,
or the exposure, which is marital status,
Married, Not Married, as our rows,
and our outcome, or dependent variable,
which is the three states,
Diagnosed Alcoholic, Undiagnosed Alcoholic,
and Not Alcoholic, as the columns.
So, this first step for us here
would be to set up the hypothesis
and determine the level of significance.
The null hypothesis here is stated as marital status
and alcoholism are independent,
and the alternative basically states that it is false.
The level of significance, as provided in our example
from our text, is 0.05.
So, now we are going to select
the appropriate test statistics,
and for this that would be a chi-square.
And the formula here is provided for chi-square.
Now, chi-square, again, is a new test we are learning
in this chapter, and for us to use chi-square
the condition has to be met.
And that condition is
for appropriate use of this test statistic,
which is chi-square, is that each expected frequency
is at least five.
In step four we will compute the expected frequencies,
and we will ensure that the condition is met.
So, the next step for us here
would be to set up our decision rule,
and that'll be degrees of freedom equal to r minus one
multiplied by c minus one.
So, the r here is the row, and the c here is the column.
So, we have two rows, so it's going to be two minus one,
and we have three columns,
so it's going to be three minus one.
And when we complete the subtraction
and do the multiplication we get two.
And from the back of our book, from the chi-square table,
now we obtain that we will reject null
if our chi-square calculated
is greater than or equal to 5.99.
With that we are going to proceed to step four.
Now we are going to compute the test statistics,
and for that the formula that we will use
is expected frequency equal to row total
multiplied by column total divided by big N.
The top number in each cell of the table
is the observed frequency,
and the bottom number is the expected frequency,
which is shown in parentheses.
So, now I'm going to do some of these calculations with you
so you kind of see step by step
how we are obtaining the expected frequencies.
So, first, as you can see,
the formula here is straightforward.
It is row total multiplied by column total
divided by the big N, and that is 280.
So, now we will pull up our calculator,
and we are going to multiply 116 by 80
and divide that by 280.
And once we do that we get the value here, which is 33.1.
I'm going to do one more here,
and I'm going to again take 116
and multiply it by the column total, which is now 100.
And now we get 11,600, we divide that by 280,
and we get 41.4.
So, as you can see, this is kind of the same process
we have to repeat to get all the expected frequencies here.
And given our expected frequencies here
are greater than five, or at least five, as you can see,
we can now proceed and use chi-square statistics.
So, the test statistics is computed as follows,
and this is the formula that was presented in step two.
As you can see, this is the big E,
which is a summation sign, and then it's O minus E.
And the O here stands for observed,
E here stands for expected,
and then that is being whole squared
and divided by the expected value.
So, now let's again do a couple of these from here
so we understand the process.
So, the observed value for the first cell is 21,
and the expected value is 33.1.
So, here we have 21 minus 33.1
whole squared divided by 33.1.
And again, the next one is going to be 37 minus 41.4
whole squared divided by 41.4
because the 37 is the observed value
and the 41.4 is the expected value.
I think you kind of got the pattern here,
so I'm not going to go through each and every cell.
However, I'm going to go through a little bit
with this calculation so, again,
we can understand algebraically
how we are getting these values.
So, we are going to take 21 and we are going to deduct 33.1,
and what we get is negative 12.1.
But as you know, when we multiply a negative number
by a negative number it becomes positive.
So, when we multiply 12.1 by 12.1 we get positive 146.41,
and then we divide that by 33.1 and we get positive 4.42.
The next one I'm going to also do for you, 37 minus 41.4,
that gives us a negative 4.4.
And when we multiply that by another negative 4.4
we get a positive 19.36,
and we divide positive 19.36 by 41.4.
And what we get is 0.468
because we have rounded it up.
So, similarly, you can go through this process
and get all the values that we need here
to calculate our chi-square value.
And after you calculate all these values
the last step would be to add them up,
and that gives us 19.7.
So, now we are at the last step, which is the conclusion,
and here we will reject the null
because 19.7 is greater than 5.99.
So, now we can conclude that we have
statistically significant evidence at the alpha level
of 0.05 to show that our null is false,
or that marital status and alcoholism are not independent.
Now, if we wanna go further and look at the p-value,
as we learned previously, we can go to the back of our book,
and as you can see, if you go to page number 349
and you go to the second row here, degrees of freedom two.
And if you go down that row
you will see the 5.99 value that we used.
And then if you move further you will see
that the next value is 7.38, the next one is 9.21,
and the last value here is 10.60.
So, basically 19.7 is not provided in this table,
but if it were provided it would be to the right of 10.60
because the values here are incrementally increasing.
Similarly, when we go to the top
and we take a look at the p-values,
they are incrementally decreasing.
So, the first p-value here is .10, the next one is .05,
the subsequent one is .025,
and the last one provided here is .005.
Therefore, the p-value for 19.7 would be less than .005
because again, if 19.7 were to be inserted in this table
in this row then it would be to the right of 10.6.
And to the right of 10.6 means
the p-value would be smaller than .005.
So, I hope this was helpful,
and please let me know if you have any questions
because I'm here to help.
Again, thank you for your attention,
and I'll see you in the next video.