| 1 |
<html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 2 |
<title>Discriminant & TableOfReal: To TableOfReal (mahalanobis)...</title> |
| 3 |
<style> |
| 4 |
td { padding-left: 5pt; padding-right: 5pt; } |
| 5 |
th { padding-left: 5pt; padding-right: 5pt; } |
| 6 |
code { white-space: pre-wrap; } |
| 7 |
dd { white-space: pre-wrap; } |
| 8 |
</style> |
| 9 |
</head><body bgcolor="#FFFFFF"> |
| 10 |
|
| 11 |
<table border=0 cellpadding=0 cellspacing=0><tr><td bgcolor="#CCCC00"><table border=4 cellpadding=9><tr><td align=middle bgcolor="#000000"><font face="Palatino,Times" size=6 color="#999900"><b> |
| 12 |
Discriminant & TableOfReal: To TableOfReal (mahalanobis)... |
| 13 |
</b></font></table></table> |
| 14 |
<p>Calculate <a href="Mahalanobis_distance.html">Mahalanobis distance</a>s for the selected <a href="TableOfReal.html">TableOfReal</a> with respect to one group in the selected <a href="Discriminant.html">Discriminant</a> object.</p> |
| 15 |
<h2>Settings</h2> |
| 16 |
<dl> |
| 17 |
<dt><b>Group label</b> |
| 18 |
<dd>defines which group mean to use for the distance calculation.</dd> |
| 19 |
<dt><b>Pool covariance matrices</b> |
| 20 |
<dd>when on, use a pooled covariance matrix instead of the group covariance matrix.</dd> |
| 21 |
</dl> |
| 22 |
<h2>Algorithm</h2> |
| 23 |
<p>See <a href="Covariance___TableOfReal__To_TableOfReal__mahalanobis__.html">Covariance & TableOfReal: To TableOfReal (mahalanobis)...</a>.</p> |
| 24 |
<h2>Example</h2> |
| 25 |
<p>Calculate the number of datapoints that are within the one-sigma elipses of two different groups, i.e. the number of data points that are in the overlapping area. </p> |
| 26 |
<p>Suppose the group labels are ø and ʏ.</p> |
| 27 |
<code> pols50m = Create TableOfReal (Pols 1973): "no"<br></code> |
| 28 |
<code> Formula: ~ log10 (self)<br></code> |
| 29 |
<code> discriminant = To Discriminant<br></code> |
| 30 |
<code> selectObject: pols50m, discriminant<br></code> |
| 31 |
<code> t1 = To TableOfReal (mahalanobis): "\o/", "no"<br></code> |
| 32 |
<code> selectObject: pols50m, discriminant<br></code> |
| 33 |
<code> t2 = To TableOfReal (mahalanobis): "\yc", "no"<br></code> |
| 34 |
<p>Now we count when both the t1 and t2 values are smaller than 1 (sigma):</p> |
| 35 |
<code> Copy: "tr"<br></code> |
| 36 |
<code> Formula: ~ object [t1] < 1 and object [t2] < 1<br></code> |
| 37 |
<code> Extract rows where column: 1, "equal to", 1<br></code> |
| 38 |
<code> no = Get number of rows"<br></code> |
| 39 |
<hr> |
| 40 |
<address> |
| 41 |
<p>© djmw 20170828</p> |
| 42 |
</address> |
| 43 |
</body> |
| 44 |
</html> |