ENGI 3423 - Two Sample Hypothesis Tests
& Regression using MINITAB


In this session we shall use Minitab® to The topic of the transposition of rows/columns of a Minitab worksheet is also covered.

Two-sample Unpaired Hypothesis Test

Example 11.05 provides the following information

An investigator wants to know which of two electric toasters has the greater ability to resist the abnormally high electrical currents that occur during an unprotected power surge.   Random samples of six toasters from factory A and five toasters from factory B were subjected to a destructive test, in which each toaster was subjected to increasing currents until it failed.   The distribution of currents at failure (measured in amperes) is known to be approximately normal for both products, with a common (but unknown) population variance.   The results are as follows:

Factory A:     20     28     24     26     23     26

Factory B:     21     18     19     17     22

Conduct the appropriate hypothesis test.


Start a new project in Minitab.

Enter the data into the worksheet.
This can be done by copy and paste operations,
but there are so few data that they can be
entered directly.   Also label the columns.

[In order to rename a worksheet,
go to the Project Manager,
right click on the name "Worksheet 1",
click on "Rename" in the pop-up menu,
type in the new name and press "Enter"]

  Data in the worksheet


Menu to 2-Sample t  

In the main menu,
click on "Stat",

then place the cursor on "Basic Statistics",

then click on the menu item "2-Sample t..."


Click on the radio button "Samples in different columns",
Click anywhere in the box "First:", (so that the column names appear in the left pane),
Select column "C1 A" into the box "First:",
Select column "C2 B" into the box "Second:",

2-Sample t dialog box

Check the box "Assume equal variances"
and click on the "Options..." button.


Options dialog box  

Change the confidence level
from 95.0 to 99.0 .

Click on the "OK" button
and back in the previous dialog box,
click on the "OK" button.


In the Session window, the following results appear:

Results in the session window
For any of the following reasons, we can reject the null hypothesis Ho: muA = muB at a level of significance of 1%:
(difference = 0) is not in the confidence interval; or
the t value of 3.36 is greater than the critical value t.005, 8 = 3.25; or
the P-value, .008, is less than 1% (though not by much!).


One may also examine the custom Excel spreadsheet demos/t2Unpaired.xls:

Excel spreadsheet


Two-sample Paired Hypothesis Test

Example 11.06 provides the following example for a paired t-test.

Nine volunteers are tested before and after a training programme.   Based on the data below, can you conclude that the programme has improved test scores?

Volunteer: 12345 6789
After training: 7566694554 85589162
Before training: 7265643951 85529258


Start a new project in Minitab.
Enter the data into the worksheet.
[Click here to skip the topic of transposing rows and columns in a Minitab worksheet.]


Transposition of Rows/Columns of a Minitab worksheet

If we use a copy and paste from this web page,
then the data appear in rows instead of columns.

Having copied the two rows of data from the web page into the clipboard, click on the first white cell in the data window and paste at that location.

In the resulting pop-up box, accept the default, "Use spaces as delimiters",
so that the worksheet appears similar to this.

Transposed data in the worksheet


Transpose menu  

To correct this problem, proceed as follows.

In the main menu,
click on "Data",

then click on the menu item "Transpose Columns..."


Enter "C3-C11" into the top right pane.

Select the radio button "After last column in use".

Transpose Columns dialog box

Click on the "OK" button.


Selected columns  

The data appear in the final columns.

Select the header of the first column "C1",
then Shift+Select the last junk column, headed "C12-T Labels".


Right click on this selection and click on "Delete Cells".

  Delete selected columns


Corrected worksheet  

The desired data are now in columns 1 and 2.

Click in the header space just above the first cell and give appropriate names to these columns


To rename the worksheet, retrieve the Project Manager.
(You can use the "Window" menu
or you can click on the icon Project Manager icon
if the Project Manager is not visible on screen).

Right-click on the name "Worksheet 1",
click on "Rename" in the pop-up menu,
type in the new name and press "Enter"]

  Renaming the worksheet


Data in the worksheet, 
   in the correct format  

The worksheet is now ready.


Two-sample Paired Hypothesis Test

Menu to Paired t  

In the main menu,
click on "Stat",

then place the cursor on "Basic Statistics",

then click on the menu item "Paired t..."


In the dialog box,

Click anywhere in the box
"First sample:",
(so that the column names
appear in the left pane),

Select column "C1 After" into
the box "First sample:",

Select column "C2 Before" into
the box "Second sample:",

and click on the
"Options..." button.

  Paired t dialog box


Options dialog box  

Change the confidence level
from 95.0 to 99.0 ,

click on the down-arrow
to change "not equal"
to "greater than".

Click on the "OK" button
and back in the previous dialog box,
click on the "OK" button.


In the Session window, the following results appear:

Results in the session window
For any of the following reasons, we can reject the null hypothesis Ho: muA = muB at a level of significance of 1%:
(difference = 0) is below the bottom of the confidence interval; or
the t value of 3.53 is greater than the critical value t.010, 8 = 2.90; or
the P-value, .004, is less than 1%.


One may also examine the custom Excel spreadsheet demos/t2test.xls:

Excel spreadsheet


Simple Linear Regression

Example 12.02 (Simple Linear Regression) is based on the identical data set to the paired t-test example above.

We can find the equation of the line of best fit through the data in the least squares sense, as follows.

With the worksheet containing
the "Before" and "After" scores open,

in the main menu,
click on "Stat",

then place the cursor on "Regression",

then click on the menu item
"Fitted Line Plot..."

  Menu to Fitted Line Plot


Click anywhere in the box "Response [Y]:",
(so that the column names appear in the left pane),

Select column "C1 After" into the box "Response [Y]:",
Select column "C2 Before" into the box "Predictor [X]:",

Fitted Line Plot dialog box

and click on the "Graphs..." button.


Graphs dialog  

Click on the radio button "Four in one".

click on the "OK" button.


Back in the "Fitted Line Plot" main dialog box,
click on the "Options..." button.


Check the box "Display confidence interval".

Supply an appropriate title.

Options dialog box

Click on the "OK" button.


The following graphs are produced.

Regression line + confidence bands

With a coefficient of determination above 99%, it is no surprise that all of the nine points lie very close to the same straight line.


The ANOVA table and other information appear in the Session window.

Session window


Normal Probability Plot for Residuals

The method of simple linear regression requires the assumption that the residuals are independent and identically distributed, with a normal distribution of zero mean and constant variance.   Due to the options exercised in the "Graphs..." dialog box, we can check this assumption.

Residual Plot  

Among the four graphs in the "Residual Plots for After" graph window is this normal probability plot of the residuals.

We can see that the residuals do appear to be consistent with the assumption of normality.


Return to the index of demonstration files   [Return to the index of demonstration files]
Return to your previous page   [Return to your previous page]

Created 2003 11 10 and most recently modified 2007 07 09 by Dr. G.H. George