pcalda: PCA-LDA

Description Usage Arguments Value Author(s) See Also Examples

View source: R/pcalda.R

Description

LDA models using principle components as input space.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  pcalda(X, Y, grouping, comps = TRUE, ...)

  ## S3 method for class 'pcalda'
 predict(object, newdata, ...)

  ## S3 method for class 'pcalda'
 coef(object, ...)

  ## S3 method for class 'pcalda'
 center(object, ...)

Arguments

X

input variate matrix

Y

matrix with class membership (classes correspond to columns). If missing, factor2matrix (grouping) is used.

grouping

factor with class membership. If missing, hardclasses (Y) is used.

...

handed to prcomp and lda (e.g. subset) lda.

predict.pcalda hands further arguments to predict.lda

comps

which principal components should be used?

object

the PCA-LDA model

newdata

the new data to apply the model to (matrix)

Value

object of class "pcalda", consisting of the prcomp object returned by prcomp and the lda object returned by lda.

Author(s)

Claudia Beleites

See Also

prcomp, lda

Examples

1
2
3
4
5
6
7
8
chondro <- chondro [! is.na (chondro$clusters)]
model <- pcalda (X = chondro[[]], grouping = chondro$clusters, comps = 1 : 3)

names (model)

pred <- predict (model)

plot

cbmodels documentation built on May 31, 2017, 2:11 a.m.