In reply to Rick Wicklin.

I have 8 variables: x1-x8

I want to compute the Mahalanobis Distance from a reference point of 7 for each of the variables.

How do I modify the above code to perform this?