D2.disc {biotools} | R Documentation |

## Discriminant Analysis Based on Mahalanobis Distance

### Description

A function to perform discriminant analysis based on the squared generalized Mahalanobis distance (D2) of the observations to the center of the groups.

### Usage

```
## Default S3 method:
D2.disc(data, grouping, pooled.cov = NULL)
## S3 method for class 'D2.disc'
print(x, ...)
## S3 method for class 'D2.disc'
predict(object, newdata = NULL, ...)
```

### Arguments

`data` |
a numeric |

`grouping` |
a vector of length |

`pooled.cov` |
a |

`x` , `object` |
an object of class |

`newdata` |
numeric |

`...` |
further arguments. |

### Value

A list of

`call` |
the call which produced the result. |

`data` |
numeric matrix; the input data. |

`D2` |
a matrix containing the Mahalanobis distances between each row of |

`means` |
a matrix containing the vector of means of each class in |

`pooled` |
the pooled covariance matrix. |

`confusion.matrix` |
an object of class |

### Author(s)

Anderson Rodrigo da Silva <anderson.agro@hotmail.com>

### References

Manly, B.F.J. (2004) *Multivariate statistical methods*: a primer. CRC Press. (p. 105-106).

Mahalanobis, P.C. (1936) On the generalized distance in statistics.
*Proceedings of The National Institute of Sciences of India*, 12:49-55.

### See Also

### Examples

```
data(iris)
(disc <- D2.disc(iris[, -5], iris[, 5]))
first10 <- iris[1:10, -5]
predict(disc, first10)
predict(disc, iris[, -5])$class
# End (not run)
```

*biotools*version 4.2 Index]