- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Mahalanobis distance can also be computed using PROC PRINCOMP in SAS/STAT. See this note.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Mahalanobis distance can also be computed using PROC PRINCOMP in SAS/STAT. See this note.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
No, you do not need IML. The CDF function is available in base SAS. See the documentation.