mahalanobis distance/syntax
Posted by Anthony Petrosino on Feb 06, 2007; 12:46am
URL: http://spssx-discussion.165.s1.nabble.com/mahalanobis-distance-syntax-tp1073707.html
Hello SPSS Users~
We are looking to solve the following.
In the context of an evaluation of an educational policy, we are using
Mahalanobis Distance (M/D) to help us in matching 46 comparison schools to
23 treatment schools, from a total pool of 411 schools.
We have two variables we are looking to compute M/D for, producing it for
each case in our data set. These variables are a sociodemographic
composite index (SCI) and an estimate of true academic performance
(essentially, math scores minus the SCI).
Has anyone ever computed M/D in SPSS for just two variables? We know that
SPSS provides the menu driven selection for M/D for regression and some of
the classification techniques, but it does not seem to fit what we are
looking for.
We have run a procedure in STATA, and used the following syntax:
_____________
*Compute Mahalanobis Distance
matrix drop _all
mkmat scix true, matrix(xvar)
matrix accum cov = scix true, noc dev
matrix cov = cov/(r(N)-1)
matrix factorx= (xvar) * (inv(cov)) * (xvar')
matrix factor= (vecdiag(factorx))'
svmat factor, names(factor)
--------------
We would like to learn how to do something similar in SPSS to validate
these findings. Like STATA, I suspect this is something that we need
special syntax for, and any clues to this will be greatly appreciated.
Sincere thanks in advance--
Anthony
Anthony Petrosino, Ph.D.
Senior Research Associate,
Learning Innovations at WestEd &
Associate Director of Research, Regional Educational Laboratory, Northeast
and Islands (REL-NEI)
200 Unicorn Park Drive, 4th floor
Woburn, MA 01824 USA
781-481-1117