Please enable JavaScript to view this site.

IBM® SPSS® Amos™ 28

Gets the squared Mahalanobis distance of an observation from the mean.

Syntax

object.MahalanobisD2 (N, covsqrt, mean, X, D2, errorflag)

The MahalanobisD2 property syntax has the following parts:

Part

Description

object

An object of type AmosRanGen.

N

Input of type Integer. The number of elements in the vector.

covsqrt

Input array of length N*(N+1)/2, of type Double. The square root of the covariance matrix. covsqrt contains the first element of the first row, the first two elements of the second row, and so on. The first element of covsqrt is passed by reference.

mean

Input array of length N, of type Double. The mean vector. The first element of mean is passed by reference.

X

Input array of length N, of type Double. The observation. The first element of X is passed by reference.

D2

Output of type Double. The squared Mahalanobis distance between X and mean.

errorflag

Output of type Integer. errorflag=1 if an error occurred, errorflag=0 otherwise.

 

© 2021 Amos Development Corporation