View source: R/choice.component.MB.R
choice.component.MB | R Documentation |
Helps the user to choose the appropriate number of MBPCAOS component to optimize
choice.component.MB( data, level.scale, blocks, blocks.name, nb.comp.to.investigate = 5, block.scaling = "inertia", supp.var = NULL )
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" |
blocks |
vector(length k) with number of variables in each bloc |
blocks.name |
vector(length k) with names of each bloc |
nb.comp.to.investigate |
Number of components to investigate (default=ncol(data)) |
block.scaling |
scaling applied to each block. Possible value are :
|
supp.var |
a vector indicating the indexes of the supplementary variables |
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.
Martin PARIES (Maintainer: martin.paries@oniris-nantes.fr)
Evelyne Vigneau
Stephanie Bougeard
data('antibiotic') antb.uses <- antibiotic[,c('Atb.conso','Atb.Sys')] health <- antibiotic[,c('Age','Loss')] vet.practices <- antibiotic[,c(6:15)] antibiotic.MB <- data.frame(antb.uses,health,vet.practices) # Defining the blocks blocks.name = c("antibiotic.uses","Health.of.turkeys","Veterinary.practices") blocks <- c(2,2,10) # Level of scaling level.scale.MB <- rep(NA,ncol(antibiotic.MB)) res.nature <- nature.variables(antibiotic.MB) level.scale.MB [res.nature$p.numeric] <- "num" level.scale.MB [res.nature$p.quali] <- "nom" #Warning; the ordinal nature of variables can not be detected automaticaly. level.scale.MB[c(1,14)] <- "ord" # Choice of number of components help(choice.component.MB) res.choice.MB <- choice.component.MB(antibiotic.MB, level.scale.MB, blocks, blocks.name, block.scaling = 'inertia') res.choice.MB
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.