Two-Sample t-Test

From Grapheme wiki


The two-sample t-test is a statistical procedure used to determine whether the mean of two independent samples of data are statistically different.

Any Hypothesis test in statistics requires the definition of a null hypothesis and an alternate hypothesis. The goal of the test is to aid the analyst in deciding which one of the two hypothesis is true. The table below shows a common set of choices for the null and alternate hypothesis for a two-sample test:

Null hypothesis Alternate hypothesis
Mean Sample 1 = Mean Sample 2 Mean Sample 1 not equal to Mean Sample 2
Mean Sample 1 = Mean Sample 2 Mean Sample 1 < Mean Sample 2
Mean Sample 1 = Mean Sample 2 Mean Sample 1 > Mean Sample 2

Before running a statistical test, the analyst must choose a significance level, or the probability of rejecting the null hypothesis given that it were true (i.e. the probability of making a wrong decision). A significance level of 0.05 (5%) is usually adopted but a different value may be used depending on the field of the study. If the p-value obtained at the end of the test is less than the selected significance level, the Null Hypothesis should be rejected in favour of the Alternate Hypothesis.

More details on the Two-Sample t-Test can be found here:

Practical Example

Suppose a laptop manufacturing company has two assembly lines assigned to the installation of the LCD displays. The manager wants to evaluate whether the two assembly lines performs differently by comparing the time it takes for each line to process a single laptop.

For each assembly line, he measures the required time for a set of 30 random observations. The first assembly line shows a mean of 873 seconds per laptop with a standard deviation of 64 seconds. The second assembly line shows a mean of 859 seconds and a standard deviation of 85. A two-sample test generates following results:

Null hypothesis Mean Sample 1 = Mean Sample 2
Alternate hypothesis Mean Sample 1 not equal to Mean Sample 2
p-Value 0.45

Being the p-value greater than the adopted significance level of 0.05, the manager doesn’t have enough evidence to conclude that the difference between the two assembly line means is statistically significant.

Within Grapheme

To perform a Two-Sample t-Test in Grapheme, click on Create New Analysis from the toolbar of the Statistical Analysis View. Assign a name to the panel and select “Two Samples T-Test” from the list. Click on Next.

Select the Source Table from the ones available in the Tables view for the First Observation Series, select the view of the table and the column containing the first sample you want to analyse. Then select the Source Table, the view and the column for the Second Observation Series. Click on Next.

Check the condition (or alternate hypothesis) you want to verify and define the Test Settings as follow:

  • Select Assume equal variance if you can assume samples have equal variance, leave unchecked otherwise
  • If you want Grapheme to evaluate the confidence interval range, check the setting Compute Confidence Interval and insert the probability value to be used for its evaluation. Click on Finish.

Grapheme: Two-Sample t-Test Panel
  • All the data available in the panel are updated on the fly, so that any change in the table values, is immediately reflected by the panel tables and charts. Automatic update can be temporary suspended, by clicking on the lock button in the main panel toolbar.
  • All the data contained in each table, can be copied to the clipboard for further reporting by clicking on the button available in the toolbar.
  • Each chart can be exported as Image by clicking on the “Save as Image” button available in the toolbar

See also