Example 4.6: Suppose that two treatment groups, in an experiment using the randomized-group design, were measured on two criterion variables X1 and X2, and that the group centroids were
xbar1' = [14.2 9.0] and xbar2' = [12.8 16.2] with pooled within-group
covariance matrix w = [567.6 215.2, 215.2 52.8].

Would you conclude that the two groups were significantly different at alpha = .01?

/* H0: mu1 eq mu2  H1: mu1 ne mu2 */
proc iml;
start;
n1 = 5; n2 = 5;
xb1 = {14.2, 9.0};
xb2 = {12.8, 16.2};
x = xb1 - xb2;
w = {567.6 215.2, 215.2 96.8};
p = nrow(w);
c = (n1 * n2 * (n1 + n2 -2))/(n1 + n2);
T2 = c # T(x)*INV(w)*x;
print T2;
df2 = n1 + n2 - p - 1;
c = df2/((n1 + n2 - 2)*p);
F = c # T2;
print F;
print "degrees of freedom = ",p," and ",df2;
finish;
run;

updated