BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ErinYume
Calcite | Level 5

Thank you Rick. I am trying to calculate a probability of the largest value from a 4 variable standardized MVN greater than a threshold. The correlation matrix is computed from a set of variance of  fleming test statistics(proc lifetest). I don't recognize the correlation matrix to have a special pattern.

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

Mahalanobis distance can also be computed using PROC PRINCOMP in SAS/STAT. See this note.

View solution in original post

4 REPLIES 4
Rick_SAS
SAS Super FREQ

It sounds like you centered and scaled so that the MVN has mean 0 and a correlation matrix as its covariance. You want to determine how probable an observation is, assuming it came from that MVN.

 

A way to do that is to compute the Mahalanobis distance from the point to the origin. The simplest way to compute the Mahalanobis distance in SAS is to use the MAHALANOBIS function in SAS/IML. The squared MD of MVN data obeys a chi-square distribution with k degrees of freedom, where k is the number of variables. Therefore one measure of the probability of an observation is 
prob = 1 - cdf("chisquare", squredMD, k);

 

I think you can also use an F distribution for this. I don't have access to my office books because of the coronavirus pandemic, but I think you can find a formula for the prediction ellipse of MVD data in most multivariate stat texts, such as R.A. Johnson and D.W. Wichern, Applied Multivariate Statistical Analysis (3rd Ed), 1992. It relates the MD to the F distribution.

 

ErinYume
Calcite | Level 5

Thank you so much for the reply. I assume the cdf() is a function available in SAS/IML, right? Unfortunately, it doesn't seem like I have the proc IML available in the SAS enterprise guide I am using. But still, I really appreciate the hint you give. 

StatDave
SAS Super FREQ

Mahalanobis distance can also be computed using PROC PRINCOMP in SAS/STAT. See this note.

Rick_SAS
SAS Super FREQ

No, you do not need IML. The CDF function is available in base SAS. See the documentation.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 575 views
  • 3 likes
  • 3 in conversation