In this video, we are going to learn how to use the TI-NSPIRE to do a Chi-Square test on a two way table.
Let's watch a few minutes of me setting up a problem. We will come back to the calculator, we will show you
how to work it, and then go back to my example - I have used it in a previous video - and discuss what the
conclusion should look like.
In our next example, we want to study the relationship between education and income levels.
We take a single SRS of the population of all working adults, size 591. Are these two variables independent
or dependent?
I am making these questions up, but I am sure in your textbook you will have a bit more of a wordy setting.
I just want to emphasize here that we are talking about one sample being taken, as opposed to 2.
Like in our first example, where we had an SRS of men and another SRS of women. And those were
independent of each other.
So the fact that this is a single SRS, and we are going to measure a couple of categorical variables within those
respondents of that SRS, we are going to have a name change for the type of Chi-square test it is.
A little bit of rewording of H-sub-0 and H-sub-a, but everything else pretty much works the same.
Or actually, identical to the first example.
Is education independent to income?
I have used this example before when we talked about 2 way tables, many chapters ago.
This is a fairly straight forward example. I have made up my own numbers. I have no high school education,
high school education, and college. And I am not talking about 2 year and 4 year degrees, and masters and
doctorate. We will just simplify it and say college education.
We have some categories of income. Less than 25,000. Between 25000 and 40000, and if you cross that 40000
threshold, we are into 40000 and 65000. Then finally, those people who make over 65000.
In green we have our observed, made up numbers, but our observed counts.
We are not going to use these proportions in the calculation of Chi-squared.
We need to, and can only work with, count values to actually run the test.
But, if we determine at the end of this problem that yes, these are indeed related or associated or dependent
variables, then I would like to be able to discuss in my summary statement what patterns did I actually
see in the data? And I am going to use these percents to do that.
I've made these column percents. You can see that I have the bottom marginal distribution.
And I am doing column percents because I do believe that your education helps to determine how
you make. As a teacher of higher level math, of course, I am hoping that the more education you have, the higher
that you do tend to make.
And that actually is a proven fact.
These, however, are just made up numbers, so that I could not worry about copyright issues and
referencing some other study.
At any rate, let's state our hypothesis and do our checks!
Since again, we are collecting this data from a single SRS, now we are going to call it a Chi-square
test for association, or independence. Our hypothesis statement is H-sub-0: Education
and income are independent. You could also say there is no association between
education and income.
H-sub-a is that education and income are dependent, or that there is an association.
Our conditions: SRS - we have randomly selected people for this study through an SRS.
Just one.
And all the expected cell counts are greater than or equal to one. And no more than 25% are less than 5.
Again, there is a formula to do this by hand, but we will be allowing the calculator to find these values in bulk,
for us, for the entire table.
So, I have written this check, but I will reference it later on in the problem after we have actually run the
Chi-Square test and allow the calculator to give us those values.
One last screen and we will be done with this example!
We get out TI-NSPIRE turned on. There is no reason to start a new document for this.
We are just going to use the ScratchPad.
So, let me tab on this button here.
Hit Menu - and go to Matrix Vector. Create a new Matrix. And select number 1.
Now, what size would you like this matrix to be?
We had 4 rows and 3 columns, so let's bump this up to number of rows, 4.
I am using my computer's touch pad, but you would be moving your finger over your calculator's touch
pad. Go over to number of columns, highlight that, and enter 3. You can also use the arrows.
Hit okay.
Here, we have our 4 by 3 matrix. Let's type these numbers in.
We have 62 - use the tab button. That's what I am using to move through the cells.
So, tab - 38, tab, 15, 25, 153, 41, 8, 98, 71, 2, 26, and 52.
Now, we have out data entered into the matrix, but we need to store it somewhere so we can use it.
I am going to click Control - Vars, or Control - Stor.
And, excuse me, I was not out of my matrix. Let's arrow over out of there.
There we go.
Let's try that again.
Control-Stor- and we are just going to pick a letter to represent a variable for the matrix we are going
to use. So, let's just store that in A.
Now that matrix is going to be stored under variable A.
And hit enter.
Okay?
Now we have the matrix stored in our calculator, let's hit Menu. Go to Statistics. Go down to Stats Test.
And choose Chi-square two way Test.
The Chi-Square goodness of fit is a test you would do for data in a one-way table.
We have this data in a two way table.
Comparing education to amount of income.
Observed Matrix - well, that observed matrix we just stored into Matrix A.
So come down here, select A, and OK.
We are already done!
When we go back to my example, we are going to have a Chi-square statistics of 211.7
We will have a pvalue, now this looks like 5.98... but look at that scientific notation.
It is E raised to the negative 43. I wanted to make sure that we had the appearance or the conclusion
that yes, education and income are not independent, or that they are dependent.
Our degree of freedom is 6, because it is number of rows minus one, times number of columns minus 1.
That is 3 minus 2 is 6.
Now we have Exp Matrix and Comp Matrix.
Let's see what those are.
The expected matrix, under vars...hold on, let's see.
Vars - arrow down until you see stat.expmatrix. If you hit enter, and hit enter again, there are your expected
cell counts.
We talked about how to calculate those by hand, by doing row total times column total, divided by the
total of the entire table.
Our calculator will calculate those for us, and give us that matrix if you have a TI-83 or 84,
it will just store that information into another matrix, like matrix B - but here, we are going to pull up
stat.expmatrix on the TI-NSPIRE.
The Comp Matrix, if you want to see that, you hit vars - go to stat.compmatrix and what this is...
this is the result of doing the observed minus excepted cell counts, squared, divided by the expected value.
These values, if you add them all up, you would get the Chi-squared statistics, which I believe from memory,
was 211.
Let's arrow up and make sure that we have that.
Yeah, 211.7.
So, these values, basically the computed matrix, would add up to that chi-square statistics of 211.
That's all there is to running the chi-square statistic test, or chi-square test on your TI-NSPIRE.
Let's go back to the video and make sure that we know how to word our conclusion to this test.
With such a very, very large Chi-square value, we are very far to the right hand tail. Almost basically off
the charts. So our p values is effectively zero.
I can't say it is zero, just because like a normal distribution, the right skewed Chi-squared distribution
is a mathematical model, and thus goes on forever.
So, I can say the p value is approximately zero, but not exactly equal to zero.
I've referenced the expected cell count matrix that my calculator will give me. Again, you will have that video
posted in a minute, and linked. However, I have this written so I can justify that condition I stated just a
minute ago about all the expected cell counts being greater than one, and no more than 20% being less
than 5. Indeed, none of them are. But, I am going to write that condition out just like it is in my book.
Conclusion: There is extremely strong evidence that education and income are dependent.
Thus, I have very strong evidence for H-sub-a, with a p value of near zero. Notice my conclusion is
incorporating my p value and referencing if I feel there is evidence for H-sub-a or not for H-sub-a.
Now this last sentence: we observe that 64% of non high school individuals...