Student’s t-test for Independent Samples

  Student’s t-test evaluates whether two independent samples are statistically different.


1 Equation:

\[ t = \frac{y_1 - y_2}{\sqrt{\left(\frac{1}{n_1} + \frac{1}{n_2}\right)s^2}} \]

Where:

  • \(y_1\) = mean of the values in the first dataset;
  • \(y_2\) = mean of the values in the second dataset;
  • \(s^2\) = pooled variance.
  The pooled variance is given by:

\[ s^2 = \frac{(n_1 - 1)s_1^2 + (n_2 - 1)s_2^2}{n_1 + n_2 - 2} \]

2 Files:

  1. testet1matrix program
  2. Program source code

3 Usage and example

1. Enter a matrix containing the two datasets;
2. Run "testet1matrix".

# Output:
1. "tval"*t* statistic;
2. "tcr5%"  – tabulated critical *t* value;
3. "pval"*p*-value of the test.


Table — Observed values for groups A and B (Vieira, 2000).

Group
A 6 5 7 3 5 2 4 8
B 7 9 6 7 6 6 9 6
\
(a) Insertion of data matrix.
(b) Results obtained from the t-test.
Figure 1: testet1matrix program running on the Android version of the HP50G calculator (Go49gp), showing data input and results for the example.


  The results are consistent with those reported by Vieira (2000), with tval = −2.366 and pval = 0.036.

4 References:

  1. Vieira, Sônia. Analysis of Variance: ANOVA. Atlas Publishing, 2000.
Back to top