Learn R Programming

ade4 (version 1.01)

discrimin: Linear Discriminant Analysis (descriptive statistic)

Description

performs a linear discriminant analysis.

Usage

discrimin(dudi, fac, scannf = TRUE, nf = 2)
plot.discrimin (x, xax = 1, yax = 2, ...) 
print.discrimin (x, ...)

Arguments

dudi
a duality diagram, object of class 'dudi'
fac
a factor defining the classes of discriminant analysis
scannf
a logical value indicating whether the eigenvalues bar plot should be displayed
nf
if scannf FALSE, an integer indicating the number of kept axes
x
an object of class 'discrimin'
xax
the column number of the x-axis
yax
the column number of the y-axis
...
further arguments passed to or from other methods

Value

  • returns a list of class 'discrimin' containing :
  • nfa numeric value indicating the number of kept axes
  • eiga numeric vector with all the eigenvalues
  • faa matrix with the loadings: the canonical weights
  • lia data frame which gives the canonical scores
  • vaa matrix which gives the cosines between the variables and the canonical scores
  • cpa matrix which gives the cosines between the components and the canonical scores
  • gca data frame which gives the class scores

See Also

lda in package MASS

Examples

Run this code
data(chazeb)
dis1 <- discrimin(dudi.pca(chazeb$tab, scan = FALSE), chazeb$cla, 
    scan = FALSE)
dis1
plot(dis1)

data(skulls)
plot(discrimin(dudi.pca(skulls, scan = FALSE), gl(5,30), 
    scan = FALSE))

Run the code above in your browser using DataLab