## Determining whether two means come from the same distribution

Useful when: you have two sets of measurements, and want to know if there has been a shift in mean value.

Use Student’s t-test for significantly different means.

Sample variance for sample A:

Similarly for sample B. Then

where

**Finding the significance level **

Use the t-distribution with degrees of freedom to compute the significance level, which is the probability that could be larger, by chance, for distributions of equal means. Thus a significance of 0.05 suggests that the means are different with 95% confidence.

**Testing against a significance level **

For e.g. a test with 95% confidence level, find the threshold value of t at 0.05 from the t-distribution. If the computed t exceeds the threshold, the means are considered different to that level of confidence.

**Code pointers**

Octave – t_test

Perl – Statistics::TTest

Spreadsheet – TTEST, TDIST, TINV

**References:**