TI-nspire calculator gives you the possibility of conducting different tests for hypothesis testing:
χ2 GOF test
χ2 2-way test
2-Sample t test
χ2 GOF test (chi-squared goodness of fit test)
The χ2 GOF test is used to verify whether certain values are results of random chance or not.
This test can help us find out if a game is fair. In our example we'll try to verify if a playing die is fair.
First, we must state the null hypothesis: "The game is fair" or "The results are completely random."
Then we must test this hypothesis by playing the game several times.
Example: We roll the die 60 times and we get 8 ones, we get 9 twos, we get 5 threes, we get 9 fours, we get 10 fives and we get 19 sixes.
These values are the actual frequencies counted experimentally. Often they are called observed frequencies.
In an ideal situation the results would be: 10 ones, 10 twos, 10 threes, 10 fours, 10 fives and 10 sixes. These are theoretical values.
They are called expected frequencies.
If you want to verify the die, you must enter observed and expected frequencies in your GDC and use the χ2 GOF function.
There are two possible methods to do it:
While on a calculator page (scratchpad), press:
menu ► Statistics ► Stat Tests ► χ2 GOF
Observed List:
{8,9,5,9,10,19}
Expected List:
{10,10,10,10,10,10}
Deg. of Freedom, df:
5
OKCancel
A dialog box will open. Enter the observed values in the first box and the expected values in the second box.
You must write each list in a curly bracket and values must be separated by a comma.
Enter the degree of freedom:
df = n − 1. Degree of freedom is equal to number of values minus one
(in our example df = 6 − 1 = 5).
The first step is to create a spreadsheet. You can simply open a new document which includes a spreadsheet:
on ► New Document ► Add Lists & Spreadsheets
An empty spreadsheet will appear on the screen.
I recommend you to label first two columns with the names of two variables:
actual and expected. The names must be entered in the first row of each column.
Leave the second row empty (this row is reserved for special formulas).
Enter the data for each variable in corresponding column.
Important: The sum of frequencies must be equal in both columns (in our example the sum is 60 in both columns).
The second step is to use the χ2 GOF function.
Put the cursor in an empty cell in your spreadsheet (e.g. column 3, second row) and use:
menu ► Statistics ► Stat Tests ► χ2 GOF
Observed List:
actual
Expected List:
expected
Deg. of Freedom, df:
5
1st Res Col:
c[ ]
Draw:
Shade P Value
OKCancel
A dialog box will open. Enter the names of your variables (e.g., actual and expected)
in boxes at "Observed List" and "Expected List".
Enter the degree of freedom:
df = n − 1. Degree of freedom is equal to number of values minus one
(in our example df = 6 − 1 = 5).
Specify in which column the results should be written
in "1st Result Column". Normally column c[ ] or column d[ ] will be just fine.
Usually the corresponding graph is not required, so you can leave the box "Draw" unticked.
After pressing OK button the calculator will display the results.
The most important result is the p-value (PVal, probability value).
If the p-value is less than the standard significance level α = 0.05, the null hypothesis must be rejected.
If the p-value is greater (or equal) than the standard significance level α = 0.05, the null hypothesis is still valid.
The other important result is the χ2 value of the observed data. This value is used when the critical χ2 value
is given. The null hypothesis must be rejected, when the χ2 of the data is greater than the critical χ2.
χ2 two-way test (chi-squared test of independence)
The χ2 two-way test (or χ2 test of indepenence) is used to verify whether
two random variables are independent. In our example we'll try to verify if movie genre preferences are independent from viewer's sex.
First, we must state the null hypothesis: "The movie genre preferences are independent from viewer's sex."
Then we must conduct a survey to test this hypothesis. After doing so, you have a table of values, called
contingency table. In our example we asked several persons (male/female) on their movie genre preferences and here are the
observed results:
female
male
horror movies
20
25
action movies
15
45
romances
50
35
melodramas
45
15
If you want to verify the hypothesis, you must enter the data in your GDC.
In this case you must use a special type of a table, called a matrix.
As first, you must enter the matrix in your GDC. Find the TEMPLATES button (to the right of number 9,
labeled )
and select the matrix template .
Select the correct number of rows and columns (in our example rows = 4, columns = 2).
Now you have an empty matrix:
Type the given values in the matrix. After completing the matrix, store it in the calculator's memory as a variable:
press ctrlsto→ and type the name of the variable, a
Now press:
menu ► Statistics ► Stat Tests ► χ2 2-way
Observed Matrix:
a
OKCancel
A dialog box will open.
Enter the name of the matrix (name of the variable where matrix is stored).
After pressing OK button the calculator will display the results.
The most important result is the p-value (PVal, probability value).
If the p-value is less than the standard significance level α = 0.05, the null hypothesis must be rejected.
If the p-value is greater (or equal) than the standard significance level α = 0.05, the null hypothesis is still valid.
The other important result is the χ2 value of the observed data. This value is used when the critical χ2 value
is given. The null hypothesis must be rejected, when the χ2 of the data is greater than the critical χ2.
Two-sample t test
The two-sample t test is used to verify whether two populations have the same mean or not.
We can select a random sample from each population and calculate its mean. However, the sample means are not equal to the population means.
Two-sample t test helps us to find out when we can use sample means to determine the relation between the population means.
First, we must state the null hypothesis: "Both population means are equal: μ1 = μ2."
Then we state the alternate hypothesis. We can do it in different ways.
If we don't have any additional information on the means, we can state the alternate hypothesis:
"The population means are different: μ1 ≠ μ2."
In this case we say that we'll perform a two-tailed test.
Sometimes we have an additional information about the means and
we can state the alternate hypothesis:
"The first population mean is less than the second one: μ1 < μ2."
(or, in other circumstances:
"The first population mean is greater than the second one: μ1 > μ2.").
In this case we say that we'll perform a one-tailed test.
We'll take a look at the ski jumping example: A certain country introduced a new ski jumping technique. Other teams use older techniques.
Here are the achievements of the competitors (in meters).
new technique
180, 185, 165, 178, 190, 188
old technique
173, 180, 178, 160, 169, 173, 181, 163
The null hypothesis is: μ1 = μ2.
We are quite convinced that the new technique is better,
so we decide to use the one-tailed test and choose the alternate hypothesis: μ1 > μ2.
If you want to verify it, you must enter the data in your GDC and use the 2-Sample t Test function.
There are two possible methods to do it:
While on a calculator page (scratchpad), press:
menu ► Statistics ► Stat Tests ► 2-Sample t Test
First, a small dialog box will appear asking you about the Data Input Method. Leave the answer "Data" and click
OK.
List 1:
{180,185,165,178,190,188}
List 2:
{173,180,178,160,169,173,181,163}
Frequency 1:
1
Frequency 2:
1
Alternate Hyp:
Ha: μ1 > μ2
Pooled:
Yes
OKCancel
Now a bigger dialog box will open. Enter the values in boxes at List 1 and List 2.
You must write each list in a curly bracket and values must be separated by a comma.
Leave frequencies set to 1.
Select the alternate hypothesis. In our case you must select μ1 > μ2, because you
are quite sure that values in the first list represent the population with the larger mean.
Select Pooled: Yes. In IB SL you will always have to select this option. This option means that the variances of both populations are equal (or nearly equal).
The first step is to create a spreadsheet. You can simply open a new document which includes a spreadsheet:
on ► New Document ► Add Lists & Spreadsheets
An empty spreadsheet will appear on the screen.
I recommend you to label first two columns with the names of two variables:
new and old. The names must be entered in the first row of each column.
Leave the second row empty (this row is reserved for special formulas).
Enter the data for each variable in corresponding column. One of the columns can be longer then the other.
The second step is to use the 2-Sample t Test function.
Put the cursor in an empty cell in your spreadsheet (e.g. column 3, second row) and use:
menu ► Statistics ► Stat Tests ► 2-Sample t Test
First, a small dialog box will appear asking you about the Data Input Method. Leave the answer "Data" and click
OK.
List 1:
new
List 2:
old
Frequency 1:
1
Frequency 2:
1
Alternate Hyp:
Ha: μ1 > μ2
Pooled:
Yes
1st Res Col:
c[ ]
Draw:
Shade P Value
OKCancel
Now a bigger dialog box will open. Enter the names of your variables,
new and old, in boxes at List 1 and List 2.
Leave frequencies set to 1.
Select the alternate hypothesis. In our case you must select μ1 > μ2, because you
are quite sure that values in the first list represent the population with the larger mean.
Select Pooled: Yes. In IB SL you will always have to select this option. This option means that the variances of both populations are equal (or nearly equal).
Specify in which column the results should be written
in "1st Result Column". Normally column c[ ] or column d[ ] will be just fine.
Usually the corresponding graph is not required, so you can leave the box "Draw" unticked.
After pressing OK button the calculator will display the results.
The most important result is the p-value (PVal, probability value).
If the p-value is less than the standard significance level α = 0.05, the null hypothesis must be rejected.
If the p-value is greater (or equal) than the standard significance level α = 0.05, the null hypothesis is still valid.