# Calculate least squares means when you have only one covariate

To calculate least squares means when you have a single covariate do the following:

1. Open PaintHardness.MTW.
2. Choose Stat > ANOVA > General Linear Model > Fit General Linear Model.
3. In Responses, enter Hardness.
4. In Factors, enter Paint and Operator.
5. In Covariates, enter Temp.
6. Click Options, and beside Means select Main effects.
7. Click OK in each dialog box.

You should obtain the following results:

### General Linear Model: Hardness versus Temp, Paint, Operator

Method Factor coding (-1, 0, +1)
Factor Information Factor Type Levels Values Paint Fixed 4 Blend 1, Blend 2, Blend 3, Blend 4 Operator Fixed 3 1, 2, 3
Analysis of Variance Source DF Adj SS Adj MS F-Value P-Value Operator 2 209.961 104.980 17.54 0.000 Paint 3 232.760 77.587 12.97 0.000 Temp 1 7.608 7.608 1.27 0.275 Error 17 101.731 5.984 Total 23 593.766
Model Summary S R-sq R-sq(adj) R-sq(pred) 2.44625 82.87% 76.82% 65.65%
Coefficients Term Coef SE Coef T-Value P-Value VIF Constant -18.4 28.3 -0.65 0.525 Operator 1 4.106 0.834 4.92 0.000 1.93 2 -4.181 0.772 -5.42 0.000 1.66 Paint Blend 1 1.256 0.934 1.34 0.197 1.75 Blend 2 -5.439 0.918 -5.92 0.000 1.69 Blend 3 0.693 0.900 0.77 0.452 1.63 Temp 1.066 0.945 1.13 0.275 1.35
Regression Equation Paint Operator Blend 1 1 Hardness = -13.0 + 1.066 Temp Blend 1 2 Hardness = -21.3 + 1.066 Temp Blend 1 3 Hardness = -17.0 + 1.066 Temp Blend 2 1 Hardness = -19.7 + 1.066 Temp Blend 2 2 Hardness = -28.0 + 1.066 Temp Blend 2 3 Hardness = -23.7 + 1.066 Temp Blend 3 1 Hardness = -13.6 + 1.066 Temp Blend 3 2 Hardness = -21.8 + 1.066 Temp Blend 3 3 Hardness = -17.6 + 1.066 Temp Blend 4 1 Hardness = -10.8 + 1.066 Temp Blend 4 2 Hardness = -19.0 + 1.066 Temp Blend 4 3 Hardness = -14.8 + 1.066 Temp
Fits and Diagnostics for Unusual Observations Obs Hardness Fit Resid Std Resid 18 6.50 10.77 -4.27 -2.04 R R Large residual
Means Fitted Term Mean SE Mean Paint Blend 1 14.83 1.09 Blend 2 8.14 1.03 Blend 3 14.27 1.02 Blend 4 17.07 1.04 Operator 1 17.68 1.02 2 9.397 0.958 3 13.653 0.844
Means for Covariates Covariate Data Mean StDev Temp 29.963 0.626
8. Next, calculate the fitted values.
1. Choose Stat > ANOVA > General Linear Model > Predict.
2. Deselect Include covariates in prediction.
3. Select Enter columns of values.
4. In the table, enter Paint in Paint and Operator in Operator. Click OK.
9. Calculate the mean of the fitted values across both factors.
1. Choose Stat > Basic Statistics > Store Descriptive Statistics.
2. In Variables, enter PFITS1.
3. In By variables (optional), enter Paint Operator. Click OK.
10. Last, calculate the means of the means for each factor separately.
1. Choose Stat > Basic Statistics > Store Descriptive Statistics.
2. In Variables, enter Mean1.
3. In By variables (optional), enter ByVar1. Click OK.
The least squares means for the different blends of paint are in the worksheet.
• Blend 1: 14.83
• Blend 2: 8.14
• Blend 3: 14.27
• Blend 4: 17.07
4. Choose Stat > Basic Statistics > Store Descriptive Statistics.
5. In By variables (optional), enter ByVar2. Click OK.
The least squares means for the different operators are in the worksheet.
• Operator 1: 17.68
• Operator 2: 9.40
• Operator 3: 13.65
By using this site you agree to the use of cookies for analytics and personalized content.  Read our policy