##
Minitab^{®}

Using our Salary example and the data in the table below, we can run through the steps for the ANCOVA. On this page we will go through the steps using Minitab.

Females | Males | ||

Salary | years | Salary | years |

80 | 5 | 78 | 3 |

50 | 3 | 43 | 1 |

30 | 2 | 103 | 5 |

20 | 1 | 48 | 2 |

60 | 4 | 80 | 4 |

**Step 1: Are all regression slopes = 0**A simple linear regression can be run for each treatment group, Males and Females. (Note: To perform regression analysis on each gender group in Minitab, we will have to sub-divide the salary data manually and separately saving the male data into Male Salary Dataset and female data into Female Salary dataset.

Running these procedures using statistical software we get the following:

##### Males

Open the Male dataset in the Minitab project file Male Salary Dataset.

From the menu bar, select

`Stat`>`Regression`>`Regression`In the pop-up window, select salary into Response and years into Predictors as shown below.

Click OK, and here is the output that Minitab displays:

#### Regression Analysis: Salary versus years

##### The regression equation is

salary = 24.8 + 15.2 years

Predictor Coef SE Coef T P Constant 24.800 7.534 3.29 0.046 years 15.200 2.272 6.69 0.007 S = 7.18331 R-Sq = 93.7% R-Sq(adj) = 91.6% ##### Analysis of Variance

Source DF SS MS F P Regression 1 2310.4 2310.4 44.78 0.007 Residual Error 3 154.8 51.6 Total 4 2465.2 ##### Females

Open Minitab dataset Female Salary Dataset.

From the menu bar select

`Stat`>`Regression`>`Regression`In the pop-up window, select salary into Response and years into Predictors as shown below.

Click OK, and here is the output that Minitab displays:

#### Regression Analysis: Salary versus years

##### The regression equation is

salary = 3.00 + 15.0 years

Predictor Coef SE Coef T P Constant 3.000 3.317 0.90 0.432 years 15.000 1.000 15.00 0.001 S = 3.16228 R-Sq = 98.7% R-Sq(adj) = 98.2% ##### Analysis of Variance

Source DF SS MS F P Regression 1 2250.0 2250.0 225.00 0.001 Residual Error 3 30.0 10.0 Total 4 2280.0 In both cases, the simple linear regressions are significant, so the slopes are not = 0.

**Step 2: Are the slopes equal?**We can test for this using our statistical software.

In Minitab we must now use GLM (general linear model) and be sure to include the covariate in the model. We will also include a ‘treatment x covariate’ interaction term and the significance of this term is what answers our question. If the slopes differ significantly among treatment levels, the interaction

*p*-value will be < 0.05.First, open the dataset in the Minitab project file Salary Dataset.

Then, from the menu select

`Stat`>`ANOVA`>`GLM (general linear model)`In the dialog box, select salary into Responses and gender into Model, and type gender*years as well.

Then, in this dialog box, click on the button "Covariates..." under the text boxes. Select years as Covariates.

Next, click on the Model box, use the shift key to highlight the gender and years, and then 'add' to create the gender*years interaction:

Click OK, and the OK again and here is the output that Minitab will display:

#### Analysis of Variance

Source DF Adj SS Adj MS F-Value P-Value year 1 4560.20 4560.20 148.06 0.000 gender 1 216.02 216.02 7.01 0.038 years*gender 1 0.20 0.20 0.01 0.938 Error 6 184.80 30.80 Total 9 5999.60 So here we see that the slopes are equal and in a plot of the regressions, we see that the lines are parallel.

**Step 3: Fit an Equal Slopes Model**We can now proceed to fit an Equal Slopes model by removing the interaction term. This can be easily accomplished by starting again with

`ANOVA`>`General Linear Model,`but now click on the second item:#### Analysis of Variance

Source DF Adj SS Adj MS F-Value P-Value year 1 4560.20 4560.20 172.55 0.000 gender 1 1254.4 1254.40 47.46 0.000 Error 7 185.0 26.43 Total 9 5999.6 To generate the mean comparisons >

`ANOVA`>`General Linear Model`, but now click on Comparisons.Comparison of salary

##### Tukey Pairwise Comparisons: Response = salary, Term = gender

#### Grouping information Using the Tukey Method and 95% Confidence

gender N Mean Grouping Male 5 70.4 A gender 5 48.0 B Means that do not share a letter are significantly different