pldam: Predictive discriminant analyses based on balanced samples.

View source: R/pldam.R

pldamR Documentation

Predictive discriminant analyses based on balanced samples.

Description

More about it

Usage

pldam(
  mat = mat,
  group = group,
  mattoid = mattoid,
  codetoid = codetoid,
  ncpts = 20,
  limproba = 0,
  limCVP = FALSE,
  nrep = 100,
  return.matrix = TRUE,
  minInd = NULL
)

Arguments

mat

matrix with the 'known' data (usually PC scores, but works also with univariate data)

group

grouping factor of the 'known' data

mattoid

matrix with the data to be predicted

codetoid

label of the specimens to predict

ncpts

number of PCs to retain

limproba

a limit for the posterior probability to be concidered

limCVP

a limit for the cross validation percent of the discriminate analysis to be concidered

nrep

number of replicates

return.matrix

logical whether to return full results

minInd

the number of specimens to include for the balanced design if smaller than the smallest of the "known" groups

Value

a list

Examples

# Some examples
# Grab some data from pig
mat <- pig$mat
gp <- pig$gp
# For the sake of reproducibility
set.seed(123)
train_ids <- sample(nrow(mat), 150, replace=FALSE)

pldam(# train data
      mat=mat[train_ids, ], group=gp[train_ids],
      # test data
      mattoid=mat[-train_ids, ], codetoid=paste0("id_", 1:nrow(mat[-train_ids, ])),
      nrep=2)

vbonhomme/mevolCVP documentation built on Aug. 24, 2024, 12:49 p.m.