Statistical tests
χ² test for independence χ² goodness of fit (GOF) test Student’s t-test

χ² Test for Independence

Consider the following set of data:

Action Horror Comedy Total
Color-blind 120 90 40 250
Non color-blind 110 95 45 250
Total 230 185 85 500

To be able to do a χ2 test, you first need to put the data in a matrix.

  1. Enter the data into a matrix. Press Menu Icon, select Matrix & Vector > Create > Matrix. Set the matrix dimensions (2×3) and enter the data.
  2. Store the matrix as A. To do that press Ctr Icon then Var Icon and enter A:

    Matrix Creation Screenshot

  3. Perform the test. Press Menu Icon, select Statistics > Stat Tests > χ² 2-way Test. Set matrix [A] as Observed. Press Enter Icon.

    Chi-Square Test Results Screenshot

    The results should display the χ² value and p-value for the test.

χ² goodness of fit (GOF) test

Consider a person counting the number of cyclists passing by their street each day:

Day Count
Monday50
Tuesday60
Wednesday42
Thursday48
Friday52
Saturday58
Sunday61

The null hypothesis (\(H_0\)) assumes that an equal number of cyclists pass by each day. The alternative hypothesis (\(H_1\)) assumes that the counts differ.

We want to know at a significance level of 0.05 if he must accept null hypothesis.

  1. Create a new document and select Add List & Spreadsheet.
  2. Fill column A with the cyclist counts and column B with the expected average count (52.8).

    Goodness of Fit Data Entry Screenshot

  3. Perform the test. Press Menu Icon, select Statistics > Stat Tests > χ² GOF, and fill the parameters accordingly.

    Goodness of Fit Parameters Screenshot

  4. Press Enter Icon to view the results.

    Goodness of Fit Results Screenshot

The results should display a χ² value of 5.57 and a p-value of 0.473. Since \(p > 0.05\), we accept the null hypothesis.

Student’s t-test

Consider the following data:

\(x_1\) \(x_2\)
2.83.1
3.23.5
2.72.8
3.53.7
3.04.2
2.92.6
4.13.2
3.92.9
-3.8

You want to test whether \(x_1 > x_2\) (\(H_1\)) at a significance level of 10%.

  1. Create a new document and select Add List & Spreadsheet. Fill column A with \(x_1\) values and column B with \(x_2\) values.

    T-Test Data Entry Screenshot

  2. Perform the test. Press Menu Icon, select Statistics > Stat Tests > 2-Sample t-Test. Set data input as Data and fill the parameters accordingly.

    T-Test Parameters Screenshot

  3. Press Enter Icon to view the results.

    T-Test Results Screenshot

    The results display \(t = -0.191\) and \(p = 0.575\). Since \(p > 0.10\), we accept the null hypothesis and conclude \(x_1 \leq x_2\).