choice.component: choice.component

View source: R/choice.component.R

choice.componentR Documentation

choice.component

Description

Helps the user to choose the appropriate number of PCAOS component to optimize

Usage

choice.component(
  data,
  level.scale = rep("num", ncol(data)),
  nb.comp.to.investigate = 5,
  supp.var = NULL
)

Arguments

data

a data frame with n rows (individuals) and p columns (numeric, nominal and/or ordinal variables)

level.scale

vector(length p) giving the nature of each variable. Possible values: "nom", "ord", "num"

nb.comp.to.investigate

Number of components to investigate (default=ncol(data))

supp.var

a vector indicating the indexes of the supplementary variables

Value

Data frame with global Loss value and percentage of the quantified variables inertia explained, for different model dimensionality (H). The last column provides the variation in percentage between to two successive size of dimensionality.

Author(s)

Examples

data("antibiotic")

#Construction of the "level.scale" argument for this dataset
level.scale <- rep(NA,ncol(antibiotic))
level.scale[c(2,3,4)] <- "num"
level.scale[c(1,5,6,7,8,9,10,11,12,13,14,15)] <- "nom"
level.scale[c(1,15)] <- "ord"

res.choice <- choice.component(antibiotic,level.scale)
res.choice


martinparies/PCAOS documentation built on March 15, 2023, 7:19 a.m.