# How to calculate Mahalanobis distance in SPSS for an exploratory factor analysis?

I have a question regarding data screening for an exploratory factor analysis (EFA).

I am conducting an EFA to identify the factor structure of 20 questions that I created on the topic of spirituality. I want to identify outliers in my sample using mahalanobis distances, and I am doing this on SPSS using a linear regression (Analyze -> Regression -> Linear).

• I entered the 20 questions in SPSS as the "Independents", but what would variable should be entered under the "Dependent" category?
• Or, if I can't use SPSS to find the mahalanobis distances, is there another (easy!!) way to find the m distances?
-
SPSS can compute Mahalanobis distances as a by-product in Linear regression and Discriminant analysis procedures. More convenient for you could be to use a special function to compute them. Take it from my web-page (Matrix - End Matrix functions). There are 2 functions for Mah. d. You'll need the second one, I guess. –  ttnphns Aug 20 '12 at 7:02
P.S. @Madeline, in responce to your 1st question: in SPSS linear regression, specify any variable as as dependent (for example, respondent's ID number); check to save Mah.d. under Save button. That would be the most easy way for you. It will save that same squared distances as my function !smahalc computes. –  ttnphns Aug 20 '12 at 8:26
Thank you ttnphns for you help! Also, I had to reverse code a few of the questions - does it matter if I enter the reverse coded or the "regular" responses when calculating mah. distances? –  Madeline Aug 20 '12 at 10:03
I can't get exactly what you mean under "reverse code" but, anyway, you could do both ways to see if the result will change. –  ttnphns Aug 20 '12 at 10:42
@ttnphns, Please post that as an answer. I would have thought you could simply use the PROXIMITIES command, but I see it is not an option. Good to know, I've never seen it used as a diagnostic tool for linear regression in my work so I would have never looked there. –  Andy W Aug 20 '12 at 12:40
show 1 more comment