cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
PhamBao
Level II

How to calculate UCL from Mahalanobis Distance

Hi all,
Currently, I am using JMP 12 version
Do you know how to calculate UCL distance from Mahalanobis Distance chart?

 

If you guy know how to get it, could you please show me the formula?


Sincerely

PhamBao_0-1664006980261.png

 

11 REPLIES 11
jthi
Super User

Re: How to calculate UCL from Mahalanobis Distance

Click the "?" from JMP toolbar and then click on Mahalanobis Distances, this will open Help page Outlier Analysis . From here you can find Mahalanobis Distance and find its documentation Mahalanobis Distance Measures and finally

jthi_0-1664009109979.png

 

-Jarmo
PhamBao
Level II

Re: How to calculate UCL from Mahalanobis Distance

Hi Jthi,

got it -- I already find the document due to your instruction.

 

However, do you know whether we can get syntax / code to calculate UCL

Thanks

Re: How to calculate UCL from Mahalanobis Distance

This example illustrates how to calculate UCL with JSL.

 

Names Default to Here( 1 );

alpha = 0.05;	// typical decision level for type I error risk
n = 1600;		// about the number in your plot
p = 5; 			// guess of the number of variables used to compute distance

ucl = Sqrt( (((n-1)^2)/n) * Beta Distribution( 1-alpha, p/2, (n-p-1)/2 ) );
PhamBao
Level II

Re: How to calculate UCL from Mahalanobis Distance

Hi,
Thank for your instruction
I try to follow your instruction but the result is not correct.
I will display the script below and image

Based on your instruction, does p =2 and n = 85

 

Multivariate(
	Y(:DELTAMINIZ, :CARRIER_X),
	Estimation Method("Row-wise"),
	Matrix Format("Square"),
	Scatterplot Matrix(Density Ellipses(1), Shaded Ellipses(0), Ellipse Color(3)),
	Jackknife Distances(1)
);



PhamBao_0-1664443159779.png

PhamBao_2-1664443291877.png

 

 

 

Re: How to calculate UCL from Mahalanobis Distance

What is the UCL shown if you click the red triangle next to Multivariate and select Outlier Analysis > Mahalanobis Distance?

 

My apologies! I used the wrong function. I also added the calculation of the jack-knife UCL. Please use this modified script instead of the one that I posted earlier.

 

Names Default to Here( 1 );

alpha = 0.05;	// typical decision level for type I error risk
n = 31;		// about the number in your plot
p = 7; 			// guess of the number of variables used to compute distance

m ucl = Sqrt( (((n-1)^2)/n) * Beta Quantile( 1-alpha, p/2, (n-p-1)/2 ) );

j ucl = Sqrt( (((n-2)*(n^2))/((n-1)^3))*((m ucl^2)/(1-((n*(m ucl^2))/((n-1)^2)))) );

Show( m ucl, j ucl );
PhamBao
Level II

Re: How to calculate UCL from Mahalanobis Distance

It works like a gem. Appreciate !

PhamBao
Level II

Re: How to calculate UCL from Mahalanobis Distance

Hi Mark_Bailey,

I use Jackknife method to detect outlier, but I found 1 case that I really need your advice.
You can refer to the images below.
Based on the right chart, all the data points on 8th carrier_x should be outliers. However, when I use Jackknife method with default settings, this method only points out 1 outlier instead 4.


I believe that not enough data points leads to the result

 

Do you have any suggestion / method that I can catch outliers more efficiently? 

PhamBao_0-1664688087639.png

 

jthi
Super User

Re: How to calculate UCL from Mahalanobis Distance

PhamBao
Level II

Re: How to calculate UCL from Mahalanobis Distance

Appreciate Jthi for your recommendation