This dialog is activated by selecting the **Two Sample t-Test...** command from the Statistics -> Hypothesis Testing -> menu.

A t-test is any statistical hypothesis test in which the test statistic follows a Student's t-distribution under the null hypothesis. The two sample t-test can be used to determine if two sets of data are significantly different from each other. It is assumed that the data is normally distributed. Please visit the Wikipedia article on the Student's t-test for more details about this statistical test.

The two-sample form of the t-Test compares the difference between the means (m_{1}-m_{2}) of the two data sets
to a m_{test} difference specified in the null hypothesis. Setting the test difference to 0 is equivalent to testing the equality of the means.
By default QtiPlot performs a two-tailed test, the default alternate hypothesis being that the difference between means and m_{test}
are different (m_{1}-m_{2} <> m_{test}).
It is also possible to perform an upper-tailed test by choosing the alternate hypothesis
that m_{1}-m_{2} > m_{test}
or a lower-tailed test (m_{1}-m_{2} < m_{test}).

This test uses the statistic t = (m_{1}-m_{2}-m_{test})/[S_{p}(1/N_{1}+1/N_{2})^{1/2}],
where S_{p} is the pooled variance of the two samples and N_{1} and N_{2}
are the sizes of the two data sets.

For an independent test S_{p} =
[((N_{1}-1)V_{1}+(N_{2}-1)V_{2})/(N_{1}+N_{2}-2)]^{1/2},
where V_{1} and V_{2} are the sample variances. For a paired test N_{1} = N_{2} and
S_{p} is calculated as the variance of the differences between the corresponding values from the two samples.

The test statistic is used to compute a probability (*P value*).
For a lower-tailed test the probability is calculated using the formula p = tcdf(t, DoF), where the *tcdf* function
calculates the lower tail of the cumulative distribution function for the
Student's t-distribution with *DoF*
degrees of freedom. For a paired test DoF = N-1, where N = N_{1} = N_{2}
is the common size of the two data sets, whereas for an independent test DoF = N_{1}+N_{2}-2.
For an upper-tailed test, the probability is calculated using the formula p = 1-tcdf(t, DoF).
For a two-tailed test the probability is calculated using the formulas p = 2tcdf(t, DoF) if tcdf(t, DoF) < 0.5 and p = 2[1-tcdf(t, DoF)] otherwise.

The null hypothesis is rejected if the calculated probability is lower than the value of the *Significance Level*.

If the *Confidence Interval(s)* box is checked QtiPlot also computes a confidence interval (*Lower Limit* and
*Upper Limit*) for each user defined level.